很抱歉,程序出现异常,即将退出
”后崩溃,没有崩溃日志。添加下面代码后
JMessageClient.registerEventReceiver(this)
继续报:很抱歉,程序出现异常,即将退出 但是没有崩溃。
然后从集成步骤开始陆续排查问题。
集成中的坑
极光IM的Demo使用的Jcore是1.17版本的
但是极光推送的Demo使用的jcore是1.19版本的
1.17版本比1.19版本要少了一些类
所以引用极光imDemo的jar,会导致集成步骤中的
<!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
<!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
<service
android:name="cn.jpush.android.service.DaemonService"
android:enabled="true"
android:exported="true">
<intent-filter >
<action android:name="cn.jpush.android.intent.DaemonService" />
<category android:name="您应用的包名"/>
</intent-filter>
</service>
这些类爆红
==========================完成集成后====================
走
JPushInterface.init(this); // 初始化 JPush
得到日志
缺少极光推送集成指南中说的 login succed
[JPushInterface] action:init
.......
[PushService] Login succeed!
后排查,发现
在处理极光推送别名的时候,我这边原本AA-BB-CC转成AABBCC的
但是极光IM的登录名,后台是要求AA-BB-CC处理成AA_BB_CC的
JMessageClient.login(UserUtil.getId().replace("-", "_"), UserUtil.getId().replace("-", "_"), new BasicCallback() { @Override public void gotResult(int responseCode, String responseMessage) { if (responseCode == 0) {
后来前后台把这两个功能统一把AA-BB-CC的帐号名处理成AA_BB_CC。
问题解决。但是原因不明。
解决后
I/JIGUANG-JCore: [ConnectingHelper] Login succeed - sid:1333, serverTime;1521085815000
D/JIGUANG-JCore: [ConnectingHelper] Action - sendServerTimer
日志中出现了Login succeed