之前用的push v3.+,为了处理Android8+的Notification Channel,需要调用setDefaultChannelId方法,只能升级到push v4.7.6。
然后,同样的代码,v3推送是好的,v4.7.6就出现莫名其妙的问题。
app在前台和后台(进程还在)的时候,在测试推送页发送一条推送,手机收不到消息,在用户状态页查到“用户 XXX 在线,未读消息数 1”,然后手机kill掉进程,手机马上就收到消息了。
参考信息
App ID : Ek1v0dkqTc2mXFBeL7wKCI2y-MdYXbMMI
SDK : v4.7.6
phone:Galaxy S6 edge+ Android 7.0
2018-12-21 20:03:19.651 7560-7560/com.wuyou.app D/com.avos.avoscloud.PushService: PushService->onCreate->106: On Create
2018-12-21 20:03:19.652 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->->47: begin to invoke AVPushConnectionManager(Context)
2018-12-21 20:03:19.678 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:03:19.728 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->->82: end of AVPushConnectionManager(Context)
2018-12-21 20:03:19.751 7560-7560/com.wuyou.app D/com.avos.avoscloud.PushService: PushService->onStartCommand->182: Start to connect to push server with installationId 332598491b8c9d4e86949043b3730491
2018-12-21 20:03:19.752 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:03:19.755 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->createNewWebSocket->208: skip create socketClient.
2018-12-21 20:03:19.770 7560-7560/com.wuyou.app D/com.avos.avoscloud.PushService: PushService->onStartCommand->182: Start to connect to push server with installationId 332598
2018-12-21 20:03:19.770 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:03:19.772 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->createNewWebSocket->208: skip create socketClient.
2018-12-21 20:03:19.807 7560-7560/com.wuyou.app D/com.avos.avoscloud.PushService: PushService$1->onWifi->122: Connectivity resumed with Wifi
2018-12-21 20:03:19.807 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:03:19.809 7560-7560/com.wuyou.app D/===AVOS Cloud===: AVPushConnectionManager->createNewWebSocket->208: skip create socketClient.
2018-12-21 20:03:20.080 7560-7643/com.wuyou.app D/===AVOS Cloud===: LogUtil$avlog->d->43: onOpen()
2018-12-21 20:04:11.082 3695-17116/? W/ActivityManager: Scheduling restart of crashed service com.wuyou.app/com.avos.avoscloud.PushService in 1000ms
2018-12-21 20:04:11.948 3695-3804/? I/ActivityManager: Start proc 7793:com.wuyou.app/u0a446 for service com.wuyou.app/com.avos.avoscloud.PushService
2018-12-21 20:04:12.066 7793-7793/? D/com.avos.avoscloud.PushService: PushService->onCreate->106: On Create
2018-12-21 20:04:12.067 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->->47: begin to invoke AVPushConnectionManager(Context)
2018-12-21 20:04:12.081 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:04:12.106 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->->82: end of AVPushConnectionManager(Context)
2018-12-21 20:04:12.119 7793-7793/? D/com.avos.avoscloud.PushService: PushService->onStartCommand->182: Start to connect to push server with installationId 332598491
2018-12-21 20:04:12.119 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:04:12.125 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->createNewWebSocket->208: skip create socketClient.
2018-12-21 20:04:12.145 7793-7793/? D/com.avos.avoscloud.PushService: PushService$1->onWifi->122: Connectivity resumed with Wifi
2018-12-21 20:04:12.145 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->initConnection->116: try to query connection server via push router.
2018-12-21 20:04:12.148 7793-7793/? D/===AVOS Cloud===: AVPushConnectionManager->createNewWebSocket->208: skip create socketClient.
2018-12-21 20:04:12.475 7793-7838/? D/===AVOS Cloud===: LogUtil$avlog->d->43: onOpen()