Search code examples
cordovaphonegap-pluginscordova-pluginsphonegap-pushplugin

Using phonegap-plugin-push in Chrome browser, iOS, and Android?


I'm missing just a single step, I can feel it...

I added the phonegap plugin to my project as so:

cordova plugin add phonegap-plugin-push --save --variable SENDER_ID="-redacted-"

and indeed it saved the entry into my config.xml file. When I build and run the browser version

cordova build myApp browser
cordova run myApp browser

I get the error message: Error: exec proxy not found for :: PushNotification :: init

In the browser project folder, under myapp\platforms\browser\platform_www\plugins there is a phonegap-plugin-push\www folder with a single push.js file, and nothing more. push.js has calls to the native plugin (eg: exec(success, fail, 'PushNotification', 'init', [options]);), but the plugin files that actually run the code are ... well, I don't exactly know. That's likely the problem, don't you think? :)

Any help getting this running in Chrome would be a big help. I'll move on and test Android after this.


Solution

  • UPDATE: Browser is supported now in phonegap-plugin-push have a look at API reference


    phonegap-plugin-push is only supported in android, iOS and windows.

    you are running your app on browser platform which is not supported by phonegap-plugin-push.

    you can get more information about plugin's platform support by looking it's plugin.xml file

    for example if you look at cordova-plugin-device's plugin.xml. you can see browser platform at line number 151

    you'll see the following

    <platform name="browser">
    ...
    </platform>
    

    but there is no platform proxy for browser in phonegap-plugin-push's plugin.xml