Ionic版本2.0 Cordova版本6.3.1 Xcode 8
已经尝试了这两个链接,但没有帮助。
http://ngcordova.com/docs/plugins/pushNotifications/
https://github.com/hollyschinsky/PushNotificationSample
正在寻找一个详细的教程或材料,用于使用Ionic获取IOS设备令牌。
Ionic版本2.0 Cordova版本6.3.1 Xcode 8
已经尝试了这两个链接,但没有帮助。
http://ngcordova.com/docs/plugins/pushNotifications/
https://github.com/hollyschinsky/PushNotificationSample
正在寻找一个详细的教程或材料,用于使用Ionic获取IOS设备令牌。
http://ngcordova.com/docs/plugins/pushNotifications/
请仅尝试此方法
我也遇到了同样的问题。
请检查测试设备的IOS操作系统版本。如果是10.0或更高版本,请在Xcode设置的功能部分进行相应更改
允许推送通知(应该已被选中)。
PFB:
if ( device.platform == 'iOS'){
pushNotification.register(
tokenHandler,
errorHandler,
{
"badge":"true",
"sound":"true",
"alert":"true",
"ecb":"onNotificationAPN"
});
}
}
function errorHandler(error) {
alert(error);
}
function tokenHandler(result){
// Your iOS push server needs to know the token before it can push to this device
// here is where you might want to send it the token for later use.
//alert('device token = ' + result);
sDeviceId = result ;
}