您的位置:首页 > 移动开发 > IOS开发

iOS10全新方法实现推送+deviceToken无法获取或无效的解决

2016-11-12 00:20 155 查看
Xcode 8和iOS10正式版出来后,这个方法做了修改,也是之前也没发现这个参数有啥用:

UNNotificationCategory *category1 = [UNNotificationCategory categoryWithIdentifier:@"Category1" actions:@[action2,action1]
minimalActions:@[action2,action1] intentIdentifiers:@[@"action1",@"action2"] options:UNNotificationCategoryOptionCustomDismissAction];

改成了:去掉了minimalActions:

UNNotificationCategory *category1 = [UNNotificationCategory categoryWithIdentifier:@"Category1" actions:@[action2,action1]
intentIdentifiers:@[@"action1",@"action2"] options:UNNotificationCategoryOptionCustomDismissAction];

在开始之前需要打开一个推送开关,不然无法获取deviceToken,老项目或者出现deviceToken无效的情况。





或许还应该打开这个



新增了UserNotifications Framework

?
?
?
?
还有推送插件开发





转:http://www.cocoachina.com/bbs/read.php?tid=1686948
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐