how push notification works for phonegap build ?

  • 1
  • Praise
  • Updated 4 years ago
can some one provide me link of a good blog or video which contain step by step process of sending push notification using google cloud messaging ?

i have gone through tons of link but still do not found any thing useful so need help to understand the concept of GCM
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@vikash,

Reviewed Video Tutorials, but none about "push" - yet!

There are many good written tutorial on push online:
Google: Phonegap push gcm tutorial

This video is for CLI, not Build - Phonegap Plugin Push Tutorial. I watched it. At this time, it is correct. If you find one for PGB, let me know.

I recommend the tutorial by devgirl.org, even though it is out of date - done in 2013. (right now the website is down, so I can't tell what has changed.)

Here is better list to search by:
Top Bloggers for Cordova/Phonegap.

Best of Luck
Jesse
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
Good to see your reply!
while Browsing i found https://pushbots.com/ as very easy
followed https://www.youtube.com/watch?v=TdXXV... step by step
but its not working
Can you help me in fixing it?
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
I'm watching it right now. My connection is bad right now. It may be a while before I respond.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@vikash,
If you have the code in a zip file, can you put it some place public so I can look at all the code and your directory strucutre.

Jesse
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
i am creating a hello world app for that i will upload zip in minutes
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
Here is my zip hello world please look into it
http://farmtocustomer.com/www.zip
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@vikash,
okay. You have two mistakes.
1) change the directory structure so that what is in the www/ is the root.
This tutorial has the example. An HTML Boilerplate for Phonegap.

2) The new security protocol means you must use CSP in the header of your index.html _OR_ remove all CSS and Javascript from the index.html (in this case just move it to a file.)

Below is the code for the CSP.
This whitelist workshee should also help.
HOW TO apply the Cordova/Phonegap whitelist system

Best of Luck
Jesse

NOTE DOING THIS WILL MAKE YOUR APP INSECURE. IT IS UP TO YOU TO SECURE YOUR APP.
Add this to your config.xml

<plugin name="cordova-plugin-whitelist" source="npm" spec="1.1.0" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" /> <!-- Required for iOS9 -->

NOTE YOUR APP IS NOW INSECURE. IT IS UP TO YOU TO SECURE YOUR APP.
Add the followin to your index.html

<meta http-equiv="Content-Security-Policy"
content="default-src *;
style-src * 'self' 'unsafe-inline' 'unsafe-eval';
script-src * 'self' 'unsafe-inline' 'unsafe-eval';">
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
i dont get your point 1 as it is still in that structure only
2> * when * is used then why to white list any other thing
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
updated app as suggested but still not working
http://farmtocustomer.com/www.zip
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
it is not working
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Vikash,
the app builds correctly.
If you are having an issue with the push, start a new thread and please say what the problem is IN THE NEW THREAD.

Jesse
Photo of vikash mishra

vikash mishra

  • 78 Posts
  • 0 Reply Likes
@Jesse
App has build successfully but push is not working
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
START A NEW THREAD.