简体   繁体   中英

How to get notification from azure phone gap iOS

I am new to mobile development. I am using Xcode 6.0 and phonegap on IOS8

I have uploaded .p12 certificate on azure mobile service.

even I am able to get token after

pushNotification.register( app.tokenHandler, app.errorHandler, { "ecb": "app.onNotificationAPN" });

but when i send notification from azure debug, my phone unable to get the notification.

Can somebody please help me to know why i am not getting notification from azure on my iOS phone

In order to receive a push notification you must give your mobile service the device token. With version 1.2.5 or later, you can use the client.push.apns.registerNative or registerTemplate function to do so if you are using Notification Hubs.

This would look something like so:

 app.tokenHandler = function (deviceToken) {
   client.push.apns.registerNative(deviceToken, ["news", "updates"]);
 }

Also, I'm not sure what the default behavior for the pushNotification module is, but I've always sent { "alert": "true" } in the 3rd param in addition to "ecb" as well. (Depending on the type of push, you may want to ask for additional types.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM