2

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.

S. J.
  • 1,106
  • 1
  • 10
  • 23
  • By running in Chrome, do you mean in a laptop browser? – nyluje May 10 '16 at 07:17
  • @nyluje Yeah, Chrome browser on Windows – S. J. May 10 '16 at 15:25
  • My guess was like the answer that has been given, it is normal it does not work. You need a device that can register to the push notification service which ever it is (GoogleCouldMsg, ApplePushNotif, and the windows one). – nyluje May 10 '16 at 15:29

1 Answers1

5

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

Arpit Vasani
  • 1,013
  • 8
  • 19
  • 1
    Ah, see, there's my misunderstanding. I saw "Supported for windows" and I thought that meant "browsers in a windows OS"! Thanks for the education. – S. J. May 10 '16 at 15:27
  • @Luth browser is supported now. added update in answer. In case you need it. – Arpit Vasani Jan 20 '17 at 09:12