通过广播启动了PushService,但是其无法接收消息。
解锁:
xml里配置如下:
<!-- Required SDK核心功能 -->
<receiver
android:name="cn.jpush.android.service.PushReceiver"
android:enabled="true"
android:exported="true"
android:process="com.ddkids.play2math.pushService" >
<intent-filter android:priority="1000" >
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> <!-- Required 显示通知栏 -->
<category android:name="com.ddkids.play2math" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
<!-- Optional -->
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
<intent-filter android:priority="2147483647" > <!-- 优先级加最高 -->
<!-- 系统启动完成后会调用 -->
<action android:name="android.intent.action.BOOT_COMPLETED" />
<!-- 解锁完成后会调用 -->
<action android:name="android.intent.action.USER_PRESENT" />
<!-- 监听情景切换 -->
<action android:name="android.media.RINGER_MODE_CHANGED" />
</intent-filter>
<intent-filter>
<!-- 系统启动完成后会调用 -->
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED"/>
<action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
</intent-filter>
</receiver>
运行输出日志log:
08-03 15:52:36.169: D/ActivityThread(27497): BDC-Calling onReceive: intent=Intent { act=android.intent.action.USER_PRESENT flg=0x24000010 cmp=com.ddkids.play2math/cn.jpush.android.service.PushReceiver }, receiver=cn.jpush.android.service.PushReceiver@3e97f139
08-03 15:52:36.169: D/JPush(27497): [PushReceiver] onReceive - android.intent.action.USER_PRESENT
08-03 15:52:36.171: D/ActivityThread(27497): BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=android.intent.action.USER_PRESENT flg=0x24000010 cmp=com.ddkids.play2math/cn.jpush.android.service.PushReceiver } packageName=com.ddkids.play2math resultCode=0 resultData=null resultExtras=null}
08-03 15:52:36.171: D/ActivityThread(27497): SVC-Calling onStartCommand: cn.jpush.android.service.PushService@209f66ff, flags=0, startId=21
08-03 15:52:36.173: D/JPush(27497): [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.RTC cmp=com.ddkids.play2math/cn.jpush.android.service.PushService (has extras) }, pkg:com.ddkids.play2math, connection:0
08-03 15:52:36.173: D/JPush(27497): [PushService] Action - handleServiceAction - action:cn.jpush.android.intent.RTC
08-03 15:52:36.175: D/JPush(27497): [PushService] Action - restartNetworkingClient, pid:27497
08-03 15:52:36.176: I/JPush(27497): [PushService] No network connection. Give up to start connection thread.
08-03 15:52:36.177: D/ActivityThread(27497): SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@2f2e5e1e startId=21 args=Intent { act=cn.jpush.android.intent.RTC cmp=com.ddkids.play2math/cn.jpush.android.service.PushService (has extras) }}
应该怎么才能让他继续接收消息呢?