-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Utilizing push plugin #91
Comments
@tgale96 the PhoneGap developer app does not include the push plugin code. The developer app is built with a number of core plugins like geolocation, camera, etc. but push is not currently one of them. You don't need to add the push.js file to your HTML file. If you add it to your project using the CLI it will be taken care of for you. Also, did you wait for the "deviceready" event before trying to call "init"? |
Oh very nice! Thanks! Any idea on what I should put for SenderId if I don't plan on using gcm? Thanks,
|
@tgale96 ignore it. If you don't ever run on Android then the options for Android will never be read. |
Yes, I have the PushNotifications instance occurring once the device ready event is registered. Thanks for the help! I will try to get it running on my phone through xcode. |
This thread has been automatically locked. |
As someone who is new to phonegap, and mobile app development in general, the documentation does not really provide any tips on how to actually use the plugin. I added it to my project as the docs say to do, and I added it to my config.xml. However, after that I really had no idea how to gain access to the APIs.
I copied the push.js file into my project and included it in my index.html, then I tried to reference the PushNotification class from my index.js but when I ran the app on my phone (using phonegap app and phonegap server) I got an error
"TypeError: undefined is not a function (evaluating 'PushNotification.init({ "android": {"senderID": "123456789"}, "ios": {}, "windows": {} })')"
It would be very nice if you could expand the documentation to explain exactly how you should gain access to the API in your app.
Thanks,
Trevor
The text was updated successfully, but these errors were encountered: