[Plugin] PhoneGap Manual PushPlugin

Post your completed addons to share with the community

Post » Wed Sep 10, 2014 9:42 pm

I've been looking for a push notification solution for PhoneGap and came across the one from @cranberrygame. It's a great plugin that works well, but it's integrated with PushWoosh and since they close off their remote API to non-paying customers, I decided to make a solution of my own.

This plugin implements PhoneGap's PushPlugin code to retrieve device tokens. There are only two actions -- register and unregister. Register will register your device using whatever service is appropriate for your operating system and unregister will unregister you. Registering will return a device token which you can access though the DeviceToken object. There are five triggers -- an OnSuccess and OnFailure for both registering and unregistering as well as OnDeviceTokenUpdated, which will trigger when a device token is received.

This plugin works with PhonegapCLI at the very least. Not sure about anything else. Here are some instructions about how to integrate the plugin to your project:

https://github.com/phonegap-build/PushP ... stallation

Since PushWoosh/UrbanAirship takes care of all the backend stuff like interfacing with the push notification services from Apple and Google, with this plugin, you'll have to find a server side solution that works given a device token. Personally, I wrote some PHP which sends the notifications when I need them to.

This code has been tested and confirmed working on Android and iOS
You do not have the required permissions to view the files attached to this post.
Last edited by gizmodude4 on Sun Feb 15, 2015 9:41 pm, edited 1 time in total.
B
4
S
1
Posts: 35
Reputation: 420

Post » Wed Sep 10, 2014 10:48 pm

Wow you did it!
Thanks for your sharing.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Dec 31, 2014 7:09 pm

Does the notification work even without an internet connection on your phone?
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Thu Jan 08, 2015 3:54 pm

damjancd wrote:Does the notification work even without an internet connection on your phone?


No, these are just push notifications from either Google's or Apple's servers, so internet connection is required. If you need notifications without an internet connection, look in to local push notifications. I think @cranberrygame has a plugin for that
B
4
S
1
Posts: 35
Reputation: 420

Post » Sun Jan 11, 2015 10:00 am

@gizmodude4 thanks dude, gizmo dude.. 4. I will search for this plugin from u/cranberrygame
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Tue Jan 13, 2015 6:58 pm

@gizmodude4

Hi gizmo

Im new to getting push notifications up and running.
I've searched a lot on the web, but cant find exactly what it is i need to do from start to finish.
Im using the build.phonegap.com service as scirra recommends, and i added your plugin to construct2.
In my project i have set: when start of layout --> register a push notification client.
But from there i truly dont know what to do...
All i find on the web is info on how to when not using c2.
Could u help?

Would be truly great!
Kind Regards.
Savvy001
B
59
S
21
G
14
Posts: 779
Reputation: 13,927


Post » Thu Jan 22, 2015 6:23 am

Savvy001 wrote:@gizmodude4

Hi gizmo

Im new to getting push notifications up and running.
I've searched a lot on the web, but cant find exactly what it is i need to do from start to finish.
Im using the build.phonegap.com service as scirra recommends, and i added your plugin to construct2.
In my project i have set: when start of layout --> register a push notification client.
But from there i truly dont know what to do...
All i find on the web is info on how to when not using c2.
Could u help?

Would be truly great!
Kind Regards.
Savvy001


I have no idea how to use it with Phonegap Build. This plugin only works for Phonegap CLI or Cordova CLI, sorry
B
4
S
1
Posts: 35
Reputation: 420

Post » Thu Feb 05, 2015 3:05 am

Hey...here is ios version
already can use(on ios7,8 pass)
will you update your plugin for android+ios?
You do not have the required permissions to view the files attached to this post.
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Thu Feb 05, 2015 6:58 am

fongka2 wrote:Hey...here is ios version
already can use(on ios7,8 pass)
will you update your plugin for android+ios?


I'll take a look at it tomorrow. I was under the impression my plugin worked for iOS? Did they update and break my plugin?
B
4
S
1
Posts: 35
Reputation: 420

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests