Tuesday, October 27, 2015

PhoneGap-Plugin-Push Version 1.4.0 Has Been Released

The latest release of the PushPlugin is now available on npm. This release is the long awaited release that is fully tested with iOS9. I was able to test on an iPhone 6+ running iOS 8.4.1, iPod Touch running iOS 9.0.2 and an iPad Air 2 running iOS 9.1.0. Please let me know if you run into any problems with this release.

On Android the switch over to using Gradle is now complete. The deprecated gcm.jar has been removed from the plugin and replaced with the Google Play Services GCM framework. Even better news is that PhoneGap Build now supports Gradle builds.

The big feature that people have been clamoring for is background or silent notifications. It is now possible for your 'notification' event handler to run when you app is in the background on iOS and Android (support for Windows coming soon).

1.4.0 (2015-10-27)

Full Changelog
Implemented enhancements:
  • Use Google's InstanceID API #188
Closed issues:
  • How to handle a re-installed app? #203
  • interactive push notifications? #266
  • Empty registrationId Android #265
  • Run callback when clicking of notification body #261
  • Android BUILD FAILED #251
  • Re-register #250
  • how to work in background ? #249
  • installing plugin #244
  • No Sound and vibration #242
  • Unable to build apk #241
  • still having problems with build. #239
  • Registering on iOS 9 #238
  • Custom sound repeated multiple times on Android #237
  • Android: status bar notification is not shown #236
  • Multiple Push Notifications - phonegap build #234
  • error: cannot find symbol String token = InstanceID.getInstance(getApplicationContext()).getToken(senderID, GCM); #231
  • Problem using "ledColor" and "VibrationPattern" #229
  • Notification event receive, but not notification showing on android #228
  • Events for registration not being fired #227
  • 'registration' event not firing on windows phone #224
  • Can i subscribe to a topic in using plugin? #219
  • GCMIntentService.java:472: error: cannot find symbol iconColor #217
  • Push Plugin registering on iOS 9 Devices but not showing Notification #216
  • Receiving a notification "outside app" while in it? #213
  • iOS push not working for device tokens when spaces removed #212
  • Error: Plugin PushPlugin failed to install. #210
  • Build error #205
  • Android push.on('registration', cb) fires correctly on device, but not in emulator. #204
  • 1.3.0 version not compatible with "crosswalk" by PGB #199
  • How to get data on didReceiveNotification Background Process #198
  • PushNotification is not defined in some devices #196
  • not getting notifications on the Android device #195
  • Installation Errors #186
  • IOS: on registration fired twice #185
  • Build failed with exit code 8 #184
  • iOS: Not able to schedule local notification after adding the plugin #183
  • How to show multiple notifications individually in android? #181
  • iOS init option type #180
  • Building for Android is a quest #179
  • How do i tell if the user open the app by tapping the notification? #176
  • IOS custom push sound when app is in background #175
  • Hi guys please post full working procedure, I'm not able to get registration id also. Please help #174
  • Has anyone tested this plugin on windows? #173

Monday, September 21, 2015

PhoneGap-Plugin-Push Version 1.3.0 Has Been Released

The latest release of the PushPlugin is now available on npm. This release switches the plugin over to using Gradle to include the Android Support Framework jar instead of it being included in the plugin. This should fix the issue where this plugin would conflict with others, like the Facebook plugin when building. Just make sure you have version 23 or later of the Android Support Library which can be installed from the Android SDK Manager.

Unfortunately, PhoneGap Build does not yet support Gradle so if you are using this plugin with PhoneGap Build you will need to use version 1.2.3 or earlier for the time being.

I know last time I said I would be making sure that iOS9 works with version 1.3.0 but I wanted to get that Gradle change out as quick as I could. Next release 1.4.0 will be full tested with iOS9 and I won't wait a full month, I'll release it just as soon as it's tested.

Full Change Log

1.3.0 (2015-09-21)

Implemented enhancements:
  • How to use GCM 3.0 with this plugin? #127
  • Android: possibility to send a notification with a title and without message #122
  • Enhancement - Led, Vibration Pattern, Priority on Android #105
Fixed bugs:
  • It is using in gcm data.additionalData ? #126
  • iOS notification from cold boot #117
  • Notification LED is not working #97
Closed issues:
  • Know which version is used in build service #151
  • Registration is not working in IOS9 #150
  • build fail on android #149
  • iconColor does not set icon background on Android #146
  • Prevent windows toast notification when in foreground #145
  • How to implement push notification for ios with this plug-in? #143
  • After installing this plugin I can't build on Android #141
  • version 1.2.3 #134
  • New inbox style on android #131
  • impossible to install the phonegap-plugin-push Error #130
  • Hello, i am developing a cordova app which requires push notifications to be sent to users android phone, so i tried using this new phonegap push plugin as old one is deprecated, and it keeps giving me an error in console: Uncaught ReferenceError: module is not defined --- Line 154 Push.js and i dont have much experience with cordova, so can anyone assist me ? #128
  • INVALID_REGISTRATION when http post request with to IOS #123
  • Andriod :More than 2 notifications in status bar it is not works. #121
  • Release notes for 1.2.x #119
  • Google cloud messaging GCM - Push Notification not being sent (Server Side) #110

1.2.3 (2015-09-08)

Fixed bugs:
  • Notification not showing..... #101
  • Same data payload for messages with action buttons #90
Closed issues:
  • Notification doesn't show the app icon #112
  • Notification doesn't show the app icon #111
  • Issue with plugin facebook connect #107
  • Cordova Support #99
  • Uncaught ReferenceError: cordova is not defined, http://localhost:8100/lib/push.js, Line: 7 #98
  • Notifications never received on Android #96
  • How know the way the app was launched #95
  • Android, example doesn't work when it goes into background #94
  • Utilizing push plugin #91

1.2.2 (2015-08-31)

Closed issues:
  • PushPlugin notification icon is too big #88

1.2.1 (2015-08-31)

Implemented enhancements:
  • Question about GCM Notifications and data in the message payload #87
Fixed bugs:
  • Notification callback for pushes without a message #80
Closed issues:
  • Android: No notification displayed on device. Notification event never called. #86
  • it seem no wp8 version for now #56

Tuesday, August 25, 2015

PhoneGap-Plugin-Push Version 1.2.0 Released!

The latest release of the PushPlugin is now available on npm. This release focuses on bringing a number of enhancements to Android notifications.

Fear not fans of other platforms as subsequent releases will have more features for your OS of choice. In fact release 1.3.0 will center around iOS9 support.

Picture Notifications

Embed a large picture in your notification. You let the plugin know you want to display a picture by setting the style of the push to picture and then giving it a picture property.

For example:
    title:"Big Picture", 
    message: "This is my big picture message", 
    style: "picture",
    picture: "http://36.media.tumblr.com/c066cc2238103856c9ac506faa6f3bc2/tumblr_nmstmqtuo81tssmyno1_1280.jpg",
    summaryText: "The internet is built on cat pictures"
Produces the cat picture on the right.

Inbox Notifications

Instead of stacking notifications in the tray you can now add multiple notifications to a single entry in the tray by setting the style to inbox. The first notification that arrives looks like normal but the subsequent ones will look like an inbox.

For example:
    title:"My Title", 
    message: "My first message", 
    style: "inbox",
    summaryText: "There are %n% notifications"
Followed by:
    title:"My Title", 
    message: "My second message", 
    style: "inbox",
    summaryText: "There are %n% notifications"
Produces the notification above.

Finally, my favourite new addition...

Action Buttons

Your notification can include action buttons. If you wish to include an icon along with the button name they must be placed in the res/drawable directory of your Android project. Then you can send the following JSON from GCM:
    title:"AUX Scrum", 
    message: "Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.", 
    actions: [
        { icon: "emailGuests", title: "EMAIL GUESTS", callback: "app.emailGuests"},
        { icon: "snooze", title: "SNOOZE", callback: "app.snooze"},
This will produce the following notification in your tray:

When the user clicks on one of the buttons it will execute the JavaScript code you specified as a callback for that button.

Check out the plugin's README for more details.

Full Change Log
1.2.0 (2015-08-25)

Implemented enhancements:
  • Implement Big Picture Style for Android #75
  • Implement Inbox style for Android #74
  • on("registration" is not getting called... #66
  • multi-line text support #63
  • Add image property to iOS and Android #39
  • Programmatically register #31
Fixed bugs:
  • Pushes being deleted from notification bar when cold start #67
  • No default sound in Android #53
  • Multiple push notification problem #48
Closed issues:
  • oficial push plugin and windows and wp8 compatibility #71
  • On Android, GCMIntentService.onError() doesn't get passed to the JavaScript "error" event #65
  • Android: add property to vibrate phone on received notification #61
  • push.on => "registration" will trigger twice times that only in iOS #57
  • Publish plugin to PhoneGap Build #22
Merged pull requests:

Monday, July 27, 2015

PhoneGap-Plugin-Push Version 1.1.1 Released!

Back during PhoneGap Day EU 2015 I announced our new PushPlugin with it's normalized API and a promise of continued support. With the release of the 1.1.1 version of the plugin we continue to fulfill that promise with some new features and bug fixes.

The most exciting new feature in this release is official support for the Windows platform! This is thanks to the wonderful team at Microsoft who contributed to the plugin to make it happen. Special thanks to Raghav Katyal and Nikhi Khandelwal!

On the Android side of things you now have way more options on how to set what icon is displayed with your push notifications:

Check out the plugin's README for more details on how to setup the each of the image types.

Full Changelog
Implemented enhancements:
  • iOS doesn't add foreground key #41
  • Android: Notification icon problem #20
  • iOS badge number #18
  • How i can set icons for push notifications in status bar and push view in android #14
  • Support Win8.1 + Phone 8.1 Universal Apps (WNS), drop support for WP8.0 (MPNS) #13
Fixed bugs:
  • iOS only reads out "aps" payload #29
  • Event not fired when in background #24
  • Custom notification sound in background mode? #17
Closed issues:
  • iOS only receives first notification in foreground #42
  • Cannot register on iOS #30
  • Fix Android paths in src folder #23
  • PushNotification not defined #21
  • Error trying to remove the plugin #19
  • Handling multiple notifications on Android devices #12
  • PGB (build.phonegap.com) problem #11
  • reporting location via gcm #6
Merged pull requests:

Friday, June 19, 2015

Including Plugins with Cordova Command Line Interface 5

You may have noticed that things have changed up a bit as of Cordova CLI 5.0.0 release. Specifically, we are now encouraging the the use of <plugin> tags in your config.xml file over the previously used <feature> tags.

You may be wondering why you should use the <plugin> tag. The main reason is that when you use the <plugin> tag it will fetch and install the plugin for you during the cordova prepare phase of building your project.

So if you have the following feature tags in your current config.xml:
<feature name="org.apache.cordova.file">
    <param name="id" value="org.apache.cordova.file@1.0.1"/>
<feature name="org.apache.cordova.file-transfer">
    <param name="id" value="org.apache.cordova.file-transfer@0.4.2"/>
<feature name="org.apache.cordova.device">
    <param name="id" value="org.apache.cordova.device@0.2.8"/>
<feature name="com.telerik.plugins.nativepagetransitions">
    <param name="id" value="https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.2.11"/>
<feature name="com.phonegap.plugins.pushplugin">
    <param name="id" value="https://github.com/phonegap-build/PushPlugin#1979d972b6ab37e28cf2077bc7ebfe706cc4dacd"/>
Then you'd just replace it with:
<plugin name="cordova-plugin-file" spec="^2.0.0" />
<plugin name="cordova-plugin-file-transfer" spec="^1.0.0" />
<plugin name="cordova-plugin-device" spec="^1.0.0" />
<plugin name="com.telerik.plugins.nativepagetransitions" spec="https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.2.11" />
<plugin name="com.phonegap.plugins.pushplugin" spec="https://github.com/phonegap-build/PushPlugin#1979d972b6ab37e28cf2077bc7ebfe706cc4dacd" />
You may have noticed that the package ID for org.apache.cordova.file has changed to cordova-plugin-file. The is part of the way plugins are now hosted on npm. You'll notice that all the core plugins (org.apache.cordova) have been renamed (see table below).

For non-core plugins you can still download them from a git repository. In order to specify a specific version you use #versionNumber for example, NativePageTransistion above or to download from a specific commit use #commitHash for example, PushPlugin above.

org.apache.cordova.battery-status cordova-plugin-battery-status
org.apache.cordova.camera cordova-plugin-camera
org.apache.cordova.contacts cordova-plugin-contacts
org.apache.cordova.device cordova-plugin-device
org.apache.cordova.device-motion cordova-plugin-device-motion
org.apache.cordova.device-orientation cordova-plugin-device-orientation
org.apache.cordova.dialogs cordova-plugin-dialogs
org.apache.cordova.file cordova-plugin-file
org.apache.cordova.file-transfer cordova-plugin-file-transfer
org.apache.cordova.geolocation cordova-plugin-geolocation
org.apache.cordova.globalization cordova-plugin-globalization
org.apache.cordova.inappbrowser cordova-plugin-inappbrowser
org.apache.cordova.media-capture cordova-plugin-media-capture
org.apache.cordova.media cordova-plugin-media
org.apache.cordova.network-information cordova-plugin-network-information
org.apache.cordova.splashscreen cordova-plugin-splashscreen
org.apache.cordova.statusbar cordova-plugin-statusbar
org.apache.cordova.whitelist cordova-plugin-whitelist
org.apache.cordova.vibration cordova-plugin-vibration

Saturday, June 13, 2015

Mud Hero 2015

So last Saturday Anna and I participated in the Mud Hero Ottawa run. It was an absolute blast as you can probably tell by looking at the smiles on our faces. We took a bunch of pictures during the day which I have in an album over here.
First up Anna ran the kids course which was three 500 meter laps with 6 obstacles. The announcer constantly mentioned to parents to make sure that the kids schools were on tight or else they would lose them in the mud pit. Predictably, this led to a bunch of parents having to dig in the mud pit for their child's missing shoe.

Anna escaped with both of her shoes but as you can see she got super muddy which I encouraged whole heartedly.
Then I finally had my chance to run the 6km course with 20 obstacles with my buddy Hicham and one of his neighbours. There were some really fun obstacles like walls, tires, ropes, slides but by far the most fun was the waist deep (or deeper) mud. You can see in this pic I've just come down the slide and luckily retrieved my hat from the mud puddle.

After the race the team from Muscle Mlk was there to hand out ready to drink protein shakes. I don't know if it was because I just ran 6km but that was the best vanilla shake I've had in a long time.

For anyone who is interested in these types of races I can offer a few tips:

  1. Bring a complete change of clothes including shoes. You will not want to put your muddy shoes on after getting clean.
  2. Wear non-cotton underwear. You really need something that isn't going to trap in a pound of dirt in your skivvies. 
  3. Bring a big fluffy towel to get warm. The "showers" are generally hoses of cold water so you will go from being over heated to freezing in no time. The fluffy towel will help.
Next up is the Bad Ass Dash on July 18th in Nepean. Anyone interested in joining?

Wednesday, June 10, 2015

Video of PhoneGap Day EU 2015 - Push N' Pull Presentation

The video for my Push N' Pull presentation is now available.

If you want to get a copy of the slides please check out my previous post.

Tuesday, May 19, 2015

PhoneGap Day EU 2015 - Push N' Pull

Yesterday, I was happy to present at PhoneGap Day EU in Amsterdam. It's one of my favourite days of the year. Besides getting to hang out with all of my co-workers who I rarely get to see in person as we are separated by half a continent I get to talk in person with the people who use our software.

At PG Day I was presenting on the work that we've been doing in order to make the lives of developers easier. My presentation introduces the new and improved Push Plugin as well as the completely new Content Sync Plugin. I'll be blogging more about these two new plugins in the up coming weeks but for now if anyone wants to check out the slides they are embedded below: