We managed to do this in the first version of our companion app on native code, unfortunatelly, we realised this feature was not available yet on Cordova, the new framework we use for building our cool responsive companion app.
The solution? Roll our own Cordova plugin to provide this functionality!
How it works
How to install
Installing this plugin is really simple, and it’s like installing any other plugin on Cordova.
cordova plugin add https://github.com/coconauts/NotificationListener-cordova
How to use
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
As far as I know, listening for notifications is only supported by Android phones (from version 4.0), and we haven’t done any IOS development in the past, so I don’t thing is possible to port this plugin to IOS. But feel free to contribute to our project if you think it can be extended to other platforms.