收到通知后,点击通知栏闪退

ios
标签: #<Tag:0x00007fb83f40aa70>

(凿壁偷光) #1

收到服务器发送的通知之后,点击通知栏后app直接闪退,报错信息如下,急需大神告知原因

2018-12-26 17:07:56.113258+0800 MyriadSchool_oc[1041:238762]  | JIGUANG | E - [JIGUANGUdpSocket] udp read error occured: errocode 57
2018-12-26 17:08:30.242243+0800 MyriadSchool_oc[1041:238338] TIC Read Status [4:0x10b733450]: 1:57
2018-12-26 17:08:30.242579+0800 MyriadSchool_oc[1041:238338] TIC Read Status [4:0x10b733450]: 1:57
2018-12-26 17:08:30.246693+0800 MyriadSchool_oc[1041:238197] dynamic_cast error 2: One or more of the following type_info's  has hidden visibility.  They should all have public visibility.   N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2018-12-26 17:08:30.246839+0800 MyriadSchool_oc[1041:238197] dynamic_cast error 2: One or more of the following type_info's  has hidden visibility.  They should all have public visibility.   N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2018-12-26 17:08:30.296068+0800 MyriadSchool_oc[1041:238197] [Bugly]  Trapped uncaught exception 'NSInvalidArgumentException', reason: '-[JPUSHService handleRemoteNotification:]: unrecognized selector sent to instance 0x104fc1ca0' 
(
	0   CoreFoundation                      0x0000000183996da4 <redacted> + 252
	1   libobjc.A.dylib                     0x0000000182b505ec objc_exception_throw + 56
	2   CoreFoundation                      0x00000001839a4098 <redacted> + 0
	3   CoreFoundation                      0x000000018399c5c8 <redacted> + 1380
	4   CoreFoundation                      0x000000018388241c _CF_forwarding_prep_0 + 92
	5   MyriadSchool_oc                     0x00000001008841f8 _ZL38MPushDidReceiveNotificationResponseIMPP11objc_objectP13objc_selectorS0_S0_U13block_pointerFvvE + 624

#2

这个日志里面没有看到有关于极光的信息,点击跳转的逻辑是你们自己实现的,需要检查下自己的代码


(凿壁偷光) #4

[JPUSHService handleRemoteNotification:]: unrecognized selector sent to instance 0x1045d17e0 这个原因跟SDK没关系么,我打断点的话,就是还没走到点击的回调方法就已经闪退了


#5

SDK 版本多少,服务端发的消息内容是什么,看下完整的 crash 信息


(凿壁偷光) #7

sdk刚我pod的最新的,我用的是平台的极光开发者服务平台做的推送测试,crash信息在哪里看。有保存到本地么


#8

crash 也是有日志,跟看日志一样吧


(凿壁偷光) #9

这是我找到的有关极光的日志,麻烦您看下

2018-12-26 17:51:18.651888+0800 MyriadSchool_oc[1088:254192]  | JIGUANG | I - [JIGUANGService] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.1.1--build:66----------
--------------------JCore Lib Version:1.2.5--build:64----------
-----------------AppKey:ac00c5b84b8da73460719fa7----------------
----------------------------------------------------------------
2018-12-26 17:51:18.656637+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2018-12-26 17:51:18.658346+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | I - [JIGUANGClientController] Action - setup

2018-12-26 17:51:19.140316+0800 MyriadSchool_oc[1088:254193]  | JIGUANG | D - [JIGUANGUserActiveReport] report content {
    date = "2018-12-26";
    duration = "87.09999999999999";
    itime = 1545817879;
    "session_id" = cd98a652467ccdfe4de95d1443435dc5;
    time = "17:31:42";
    timezone = "+8";
    type = "active_terminate";
}
2018-12-26 17:51:19.152918+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2018-12-26 17:51:19.219554+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession
2018-12-26 17:51:19.221733+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2018-12-26 17:51:19.222164+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1
2018-12-26 17:51:19.227517+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2018-12-26 17:51:19.234646+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] Action - connect
2018-12-26 17:51:19.238848+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2018-12-26 17:51:19.239499+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2018-12-26 17:51:19.240021+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2018-12-26 17:51:19.243560+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2018-12-26 17:51:19.244854+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2018-12-26 17:51:19.255810+0800 MyriadSchool_oc[1088:254212]  | JIGUANG | D - [JIGUANGAddressController] get address :43.247.88.107 from host : s.jpush.cn
2018-12-26 17:51:19.256328+0800 MyriadSchool_oc[1088:254212]  | JIGUANG | D - [JIGUANGTcpAddressSis] Action - sendSisRequest:toDefaultPort:toCustomPort
2018-12-26 17:51:19.256553+0800 MyriadSchool_oc[1088:254212]  | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2018-12-26 17:51:19.262880+0800 MyriadSchool_oc[1088:254193] Missing server connection for kCTConnectionInvalidatedNotification
2018-12-26 17:51:19.264468+0800 MyriadSchool_oc[1088:254193]  | JIGUANG | D - [JIGUANGUdpSocket] send udp data
2018-12-26 17:51:19.264881+0800 MyriadSchool_oc[1088:254193]  | JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed
2018-12-26 17:51:19.265425+0800 MyriadSchool_oc[1088:254193]  | JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior
2018-12-26 17:51:19.311565+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGTcpAddressSis] Action - parse
018-12-26 17:51:20.365802+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <89655cd4 95d13cda 54086957 aadb76e9 da14d7d5 54b9dc9d 8f0c9f41 b0bc1f73>
2018-12-26 17:51:20.490962+0800 MyriadSchool_oc[1088:254213]  | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest
2018-12-26 17:51:20.499765+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 89655cd495d13cda54086957aadb76e9da14d7d554b9dc9d8f0c9f41b0bc1f73
2018-12-26 17:51:20.566066+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | I - [JIGUANGLogin] 
----- login result -----
uid:16475411566 
registrationID:18171adc032298d1b23 
idc:1
2018-12-26 17:51:20.566254+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
2018-12-26 17:51:20.566345+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:
2018-12-26 17:51:20.567020+0800 MyriadSchool_oc[1088:254191]  | JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond
2018-12-26 17:51:20.569988+0800 MyriadSchool_oc[1088:254227]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null)
-[JPUSHService handleRemoteNotification:]: unrecognized selector sent to instance 0x105634120

#11

先提供下崩溃堆栈,然后检查下你调用【JPUSHService handleRemoteNotification:】传进来的参数是什么


(凿壁偷光) #12
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
    // Required
    
    NSDictionary * userInfo = response.notification.request.content.userInfo;
    
    if (@available(iOS 10.0, *)) {
        if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
            [JPUSHService handleRemoteNotification:userInfo];
        }
    } else {
        // Fallback on earlier versions
    }

bugly的分析是这样的


#13

bugly 的截图完整一点

具体的参数值


(凿壁偷光) #14
0 CoreFoundation ___exceptionPreprocess + 228
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation ___methodDescriptionForSelector
3 CoreFoundation _forwarding + 1380
4 CoreFoundation _CF_forwarding_prep_0 + 92
5 MyriadSchool_oc MPushDidReceiveNotificationResponseIMP(objc_object*, objc_selector*, objc_object*, objc_object*, void () block_pointer) + 624
6 UIKit -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 2664
7 UIKit -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1632
8 UIKit ___82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 296
9 UIKit -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
10 UIKit ___125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
11 UIKit _performActionsWithDelayForTransitionContext + 112
12 UIKit -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
13 UIKit -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
14 UIKit -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 468
15 FrontBoardServices 0x000000018618c000 + 53028
16 libdispatch.dylib _dispatch_client_callout + 16
17 libdispatch.dylib _dispatch_block_invoke_direct + 232
18 FrontBoardServices 0x000000018618c000 + 264312
19 FrontBoardServices 0x000000018618c000 + 263452
20 FrontBoardServices 0x000000018618c000 + 264888
21 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
22 CoreFoundation ___CFRunLoopDoSources0 + 276
23 CoreFoundation ___CFRunLoopRun + 1204
24 CoreFoundation CFRunLoopRunSpecific + 552
25 GraphicsServices GSEventRunModal + 100
26 UIKit UIApplicationMain + 236
27 MyriadSchool_oc main + 124
28 libdyld.dylib _start + 4

这是完整的bugly信息

这里是userinfo的信息
Printing description of userInfo:
{
“_j_business” = 1;
“_j_msgid” = 58546798439743229;
“_j_uid” = 16475411566;
aps = {
alert = “\U60a8\U6709\U4e00\U6761\U9910\U5238\U7533\U8bf7\U7b49\U5f85\U5ba1\U6279\Uff01”;
};
}
我试着把JPUSHService handleRemoteNotification:】 这个方法注销了,但还是相同的崩溃原因。
除了- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler这个回调方法在接受到消息的时候走了之外,别的点击通知栏的回调都没走


#15

image

这个崩溃里面 是你们自己的方法吧?

看这个堆栈信息,应该是这里面哪里的调用有问题,都还没走到点击的回调去呢


(凿壁偷光) #16

我全局搜了下,我们没有用的这个方法,我自己试了下本地通知,本地通知的话点击通知栏就能顺利进入app,是不是SDK内部进行了什么操作,我刚把pod删了,手动导了库,初始化什么的也是按demo里面来的,也是同样的错误


#17

你们是不是还用了其他的推送 SDK?找下其他 SDK里面是不是有这个方法
MPushDidReceiveNotificationResponseIMP


(凿壁偷光) #18

谢谢。解决了。是之前有人倒入了别的推送SDK,可能内部冲突了