注册

更新推送的时候崩溃 [EMPushOptions(Private) toCorePtrWithoutIgnoredGroupIds]

出现问题部分的代码如下
EMPushOptions *option =    [[EMClient sharedClient] getPushOptionsFromServerWithError:nil];

option.displayStyle = EMPushDisplayStyleMessageSummary;

EMError *error=[[EMClient sharedClient] updatePushOptionsToServer];
具体表现是当环信服务器连接不上或者出现问题时,线上大规模的Crash。平时也有零星的Crash。
Bugly收集到的崩溃日志如下
SEGV_ACCERR
[EMPushOptions(Private) toCorePtrWithoutIgnoredGroupIds]
 
堆栈如下
 
 
#0 Thread

SIGSEGV

SEGV_ACCERR
 
0 libsystem_c.dylib strlen + 12
1 KHW -[EMPushOptions(Private) toCorePtrWithoutIgnoredGroupIds] + 132
2 KHW -[EMPushOptions(Private) toCorePtrWithoutIgnoredGroupIds] + 132
3 KHW -[EMClient updatePushOptionsToServer] + 232
4 KHW -[XYChatManager updateHXConfig:] (XYChatManager.m:197)
5 libdispatch.dylib __dispatch_call_block_and_release + 24
6 libdispatch.dylib __dispatch_client_callout + 16
7 libdispatch.dylib _dispatch_main_queue_callback_4CF + 1000
8 CoreFoundation ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9 CoreFoundation ___CFRunLoopRun + 1660
10 CoreFoundation CFRunLoopRunSpecific + 444
11 GraphicsServices GSEventRunModal + 180
12 UIKit -[UIApplication _run] + 684
13 UIKit UIApplicationMain + 208
14 KHW main (main.m:14)
15 libdyld.dylib _start + 4
 
现将代码修改为
EMError *err=nil;
EMPushOptions *option = [[EMClient sharedClient] getPushOptionsFromServerWithError:&err];
option.displayStyle = EMPushDisplayStyleMessageSummary;

if(err)
{
//上报错误
return;
}
EMError *error=[[EMClient sharedClient] updatePushOptionsToServer];
不知道是否可以解决此问题。谢谢。
已邀请:
这个最好测试看崩溃出现在哪一句,看看是否是在
getPushOptionsFromServerWithErro
崩溃
同样出现crash
[EMClient updatePushOptionsToServer]
只不过我还多了更内部的一句
[EMPushOptions(Private) toCorePtrWithoutIgnoreGroupIds]
看下调用
[[EMClient sharedClient] updatePushOptionsToServer]和
[[EMClient sharedClient] getPushOptionsFromServerWithError:&err]
是否在登录成功之后

要回复问题请先登录注册