---------------->Bug_001<----------------
iOS 10 新增了大量關(guān)于通知的新特性辆童,詳情參照極光官方的Blog耻陕。
iOS 10新增了Service Extension
錯誤日志如下:
Undefined symbols for architecture arm64:
"_dns_parse_resource_record", referenced from:
-[JPushExtensionSRVResolver processRecord:length:] in jpush-extension-ios-1.1.1.a(JPushExtensionSRVResolver.o)
"_dns_free_resource_record", referenced from:
-[JPushExtensionSRVResolver processRecord:length:] in jpush-extension-ios-1.1.1.a(JPushExtensionSRVResolver.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決辦法就是: 添加相關(guān)的依賴庫 libresolv.tbd 就可以了
---------------->Bug_002<----------------
極光錯誤提示:
| JIGUANG | W - [JIGUANGDeviceTokenController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed? or there is no APNs register code? Please refer to JPush docs.
| JIGUANG | W - [JIGUANGDeviceTokenController] Not get deviceToken yet. After successful login, a custom message can be sent, but the APNs notification cannot. Until the deviceToken is obtained and reported successfully, the APNs notification can be used normally.
這樣的錯誤提示恭取,是因為在
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
這個方法里,沒有執(zhí)行極光推送的方法將deviceToken傳給SDK
// 將得到的deviceToken傳給SDK
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[[EMClient sharedClient] bindDeviceToken:deviceToken];
});
[JPUSHService registerDeviceToken:deviceToken];
}
但是我明明在 AppDelegate.m 里面實現(xiàn)了上面的方法,并寫入了極光推送的注冊DeviceToken方法弛房,但是發(fā)現(xiàn)就是不走上面的方法值骇,后來看到了下面這篇博客莹菱,原來有人跟我遇到了同樣的問題,就是在使用環(huán)信IM的時候吱瘩,同時也集成了極光推送道伟,在使用環(huán)信IM的時候,它在AppDelegate的分類中重寫了方法didRegisterForRemoteNotificationsWithDeviceToken: 使碾,覆蓋了我在AppDelegate中寫的方法蜜徽,所以導(dǎo)致我在方法里寫的極光推送注冊deviceToken的方法不執(zhí)行。
錯誤記錄的博客 Not get deviceToken yet. Maybe: your certificate not configured APNs?
http://www.cocoachina.com/bbs/read.php?tid=257513&page=e&#a
原來 環(huán)信IM 為AppDelegate 添加了一個 類目:AppDelegate+EaseMob.h,重寫了
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
票摇,所以之前的app delete 里面寫了
[JPUSHService registerDeviceToken:deviceToken];
沒有調(diào)用拘鞋,所以收不到推送。
找了半天矢门,才發(fā)現(xiàn)盆色。
解決辦法:就是將極光推送的deviceToken注冊方法放到 AppDelegate+EaseMob.h 文件中的 didRegisterForRemoteNotificationsWithDeviceToken: 方法里灰蛙。
希望可以幫到一部分人。