Utilizing push plugin #91

Closed
tgale96 opened this Issue Aug 31, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@tgale96

tgale96 commented Aug 31, 2015

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

@macdonst

This comment has been minimized.

Show comment
Hide comment
@macdonst

macdonst Sep 1, 2015

Member

@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"?

Member

macdonst commented Sep 1, 2015

@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"?

@tgale96

This comment has been minimized.

Show comment
Hide comment
@tgale96

tgale96 Sep 1, 2015

Oh very nice! Thanks!

Any idea on what I should put for SenderId if I don't plan on using gcm?

Thanks,
Trevor

On Aug 31, 2015, at 10:28 PM, Simon MacDonald notifications@github.com wrote:

@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.


Reply to this email directly or view it on GitHub.

tgale96 commented Sep 1, 2015

Oh very nice! Thanks!

Any idea on what I should put for SenderId if I don't plan on using gcm?

Thanks,
Trevor

On Aug 31, 2015, at 10:28 PM, Simon MacDonald notifications@github.com wrote:

@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.


Reply to this email directly or view it on GitHub.

@macdonst

This comment has been minimized.

Show comment
Hide comment
@macdonst

macdonst Sep 1, 2015

Member

@tgale96 ignore it. If you don't ever run on Android then the options for Android will never be read.

Member

macdonst commented Sep 1, 2015

@tgale96 ignore it. If you don't ever run on Android then the options for Android will never be read.

@tgale96

This comment has been minimized.

Show comment
Hide comment
@tgale96

tgale96 Sep 1, 2015

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.

tgale96 commented Sep 1, 2015

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.

@tgale96 tgale96 closed this Sep 1, 2015

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot Jun 5, 2018

This thread has been automatically locked.

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@phonegap phonegap locked as resolved and limited conversation to collaborators Jun 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.