Fixed enableForegroundDispatch bug by ensuring application is active.
Merge pull request #67 from ronnied/master

Fixed enableForegroundDispatch bug by ensuring application is active.