I tried to find a way to get base url of mixed (http + CLI) application. CLI is used to do some regular notifications, where app url is used.
I tried this, but it returns me only "http://"
print_r($this->getEvent()->getApplication()->getServiceManager()->get('ViewHelperManager')->get('ServerUrl')->__invoke());