离子版本2.0 Cordova版本6.3.1Xcode 8
已经尝试了这两个链接,但没有帮助。
http://ngcordova.com/docs/plugins/pushNotifications/
https://github.com/hollyschinsky/PushNotificationSample
寻找一个详细的教程/材料获取设备令牌的IOS使用离子。
发布于 2016-12-21 07:13:31
要使用Ionic推送通知,您必须有最近发布的Ionic版本,即Ionic版本2,如果您有旧版本(低于Ionic版本1),它将无法工作。
CordovaPush,CordovaPush v5已经被废弃,所以不要使用它们。
有关Ionic 2中推送通知的详细理解,请参阅本离子2推
发布于 2016-11-29 11:25:19
你必须使用这个插件
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 ;
}在sDeviceId中,您可以获得设备令牌。
发布于 2016-11-29 11:29:03
http://ngcordova.com/docs/plugins/pushNotifications/
只试这个
我也面临着同样的问题。
请检查IOS操作系统版本的测试设备。如果是10.0或以上,请做
“能力”部分中Xcode设置的适当更改
允许推送通知(应该检查它)。
PFB:
https://stackoverflow.com/questions/40864269
复制相似问题