ionic+ cordova ios 收不到推送消息

收不到消息
标签: #<Tag:0x00007fb83ff50d08>

(冷月轩) #1

上周还能正常推送,现在测试就不能用了,不知道什么原因,push notification和background mode都已经打开。 用xcode编译运行后,打印如下:

2018-07-23 17:06:30.804727+0800 test1[1104:88620] Apache Cordova native platform version 4.4.0 is starting.
2018-07-23 17:06:30.805250+0800 test1[1104:88620] Multi-tasking -> Device: YES, App: YES
2018-07-23 17:06:30.813144+0800 test1[1104:88620] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-07-23 17:06:30.841499+0800 test1[1104:88620] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-07-23 17:06:30.841557+0800 test1[1104:88620] Using Ionic WKWebView
2018-07-23 17:06:30.841841+0800 test1[1104:88620] [CDVTimer][handleopenurl] 0.056982ms
2018-07-23 17:06:30.842928+0800 test1[1104:88620] [CDVTimer][intentandnavigationfilter] 1.064897ms
2018-07-23 17:06:30.842984+0800 test1[1104:88620] [CDVTimer][gesturehandler] 0.038028ms
2018-07-23 17:06:30.843019+0800 test1[1104:88620] CDVIonicKeyboard: resize mode 1
2018-07-23 17:06:30.843322+0800 test1[1104:88620] [CDVTimer][keyboard] 0.298977ms
2018-07-23 17:06:30.863592+0800 test1[1104:88620] [CDVTimer][splashscreen] 20.244956ms
2018-07-23 17:06:30.863629+0800 test1[1104:88620] [CDVTimer][TotalPluginStartup] 21.864057ms
2018-07-23 17:06:30.877503+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:94e71d51bc993d93cbb9e0da channel:channel name isProduction:FALSE advertisingIdentifier: 
2018-07-23 17:06:30.878977+0800 test1[1104:88682]  | JIGUANG | I - [JIGUANGService] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.7--build:45----------
--------------------JCore Lib Version:1.1.6--build:29----------
-----------------AppKey:94e71d51bc993d93cbb9e0da----------------
----------------------------------------------------------------
2018-07-23 17:06:30.879321+0800 test1[1104:88679]  | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2018-07-23 17:06:30.879524+0800 test1[1104:88680]  | JIGUANG | I - [JIGUANGClientController] Action - setup
2018-07-23 17:06:30.898467+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGPageFlow] trySetupSession
2018-07-23 17:06:30.898675+0800 test1[1104:88680]  | JIGUANG | D - [JIGUANGPageFlow] setupSession
2018-07-23 17:06:30.898880+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGPageFlow] resetCurrentPage
2018-07-23 17:06:30.903238+0800 test1[1104:88678]  | JIGUANG | W - [JIGUANGService] 请将JPush的初始化方法,添加到[UIApplication application: didFinishLaunchingWithOptions:]方法中,否则JPush将不能准确的统计到通知的点击数量。参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6
2018-07-23 17:06:30.906648+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <32a195bd 46c1abac 13025939 5c4b2f4a 137d38f6 d356cf88 75319480 f36a7d54>
2018-07-23 17:06:30.907391+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 32a195bd46c1abac130259395c4b2f4a137d38f6d356cf8875319480f36a7d54
2018-07-23 17:06:30.907802+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession
2018-07-23 17:06:30.907984+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2018-07-23 17:06:30.908162+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1, curNetworkStatus: 2
2018-07-23 17:06:30.908324+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2018-07-23 17:06:30.908493+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGSessionController] Action - connect
2018-07-23 17:06:30.908883+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2018-07-23 17:06:30.909053+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2018-07-23 17:06:30.909407+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2018-07-23 17:06:30.909570+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2018-07-23 17:06:30.909916+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2018-07-23 17:06:31.658257+0800 test1[1104:88620] ### pluginInitialize
2018-07-23 17:06:31.659187+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGService] Action - setDebugMode
2018-07-23 17:06:32.934805+0800 test1[1104:88709]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : s.jpush.cn
2018-07-23 17:06:34.963402+0800 test1[1104:88707]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : sis.jpush.io
2018-07-23 17:06:36.992624+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : easytomessage.com
2018-07-23 17:06:37.999629+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
2018-07-23 17:06:38.001221+0800 test1[1104:88680]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
2018-07-23 17:06:38.002660+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] connectTcp:(null)
2018-07-23 17:06:41.034496+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGSessionController] Action - reenqueueSendingRequests
2018-07-23 17:06:41.035430+0800 test1[1104:88680]  | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2018-07-23 17:06:43.061518+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGSessionController] Action - startDelaySetupTimer
2018-07-23 17:06:43.063075+0800 test1[1104:88793]  | JIGUANG | D - [JIGUANGSessionController] session will setup delayed with time interval: 2.000000
2018-07-23 17:06:45.064469+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2018-07-23 17:06:45.066013+0800 test1[1104:88793]  | JIGUANG | D - [JIGUANGSessionController] Action - connect
2018-07-23 17:06:45.067266+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2018-07-23 17:06:45.068374+0800 test1[1104:88793]  | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2018-07-23 17:06:45.069375+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2018-07-23 17:06:45.070441+0800 test1[1104:88793]  | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2018-07-23 17:06:45.071898+0800 test1[1104:88679]  | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2018-07-23 17:06:47.098901+0800 test1[1104:88678]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : s.jpush.cn
2018-07-23 17:06:49.125943+0800 test1[1104:88839]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : sis.jpush.io
2018-07-23 17:06:51.152547+0800 test1[1104:88793]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : easytomessage.com
2018-07-23 17:06:52.158909+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
2018-07-23 17:06:52.160599+0800 test1[1104:88853]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
2018-07-23 17:06:52.161988+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGSessionController] connectTcp:(null)
2018-07-23 17:06:55.194096+0800 test1[1104:88853]  | JIGUANG | D - [JIGUANGSessionController] Action - reenqueueSendingRequests
2018-07-23 17:06:55.195706+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2018-07-23 17:06:57.224335+0800 test1[1104:88853]  | JIGUANG | D - [JIGUANGSessionController] Action - startDelaySetupTimer
2018-07-23 17:06:57.225996+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGSessionController] session will setup delayed with time interval: 5.000000
2018-07-23 17:07:00.141217+0800 test1[1104:88620] Status bar could not find cached time string image. Rendering in-process.
2018-07-23 17:07:02.231085+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2018-07-23 17:07:02.232624+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGSessionController] Action - connect
2018-07-23 17:07:02.234147+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2018-07-23 17:07:02.235662+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2018-07-23 17:07:02.237027+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2018-07-23 17:07:02.238189+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2018-07-23 17:07:02.239660+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2018-07-23 17:07:02.944500+0800 test1[1104:88709]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : s.jpush.cn
2018-07-23 17:07:04.972807+0800 test1[1104:88707]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : sis.jpush.io
2018-07-23 17:07:04.974853+0800 test1[1104:88866]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : easytomessage.com
2018-07-23 17:07:05.980395+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
2018-07-23 17:07:05.981924+0800 test1[1104:88931]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
2018-07-23 17:07:05.983449+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGSessionController] connectTcp:(null)
2018-07-23 17:07:09.014981+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] Action - reenqueueSendingRequests
2018-07-23 17:07:09.016541+0800 test1[1104:88868]  | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2018-07-23 17:07:09.019339+0800 test1[1104:88866]  | JIGUANG | D - [JIGUANGSessionController] Action - startDelaySetupTimer
2018-07-23 17:07:09.021214+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] session will setup delayed with time interval: 20.000000
2018-07-23 17:07:29.026867+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2018-07-23 17:07:29.028638+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] Action - connect
2018-07-23 17:07:29.029930+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2018-07-23 17:07:29.031054+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2018-07-23 17:07:29.032358+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2018-07-23 17:07:29.033437+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2018-07-23 17:07:29.034502+0800 test1[1104:88845]  | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2018-07-23 17:07:31.062525+0800 test1[1104:88866]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : s.jpush.cn
2018-07-23 17:07:32.248245+0800 test1[1104:88682]  | JIGUANG | E - [JIGUANGAddressController] DNS request failed
2018-07-23 17:07:32.250032+0800 test1[1104:88681]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : sis.jpush.io
2018-07-23 17:07:32.949166+0800 test1[1104:88709]  | JIGUANG | D - [JIGUANGAddressController] get address :(null) from host : easytomessage.com
2018-07-23 17:07:33.956480+0800 test1[1104:88709]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
2018-07-23 17:07:33.958046+0800 test1[1104:89038]  | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
2018-07-23 17:07:33.959156+0800 test1[1104:88709]  | JIGUANG | D - [JIGUANGSessionController] connectTcp:(null)
2018-07-23 17:07:34.978745+0800 test1[1104:88707]  | JIGUANG | E - [JIGUANGAddressController] DNS request failed
2018-07-23 17:07:34.980616+0800 test1[1104:88682]  | JIGUANG | D - [JIGUANGSessionController] Action - reenqueueSendingRequests
2018-07-23 17:07:34.982061+0800 test1[1104:88707]  | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:

#2

根据当前日志无法判断你是集成成功还是失败,多运行一会,看是否有更多的日志。

你的网络状态如何?用 4 G 看下


(冷月轩) #3

测试方法使用web上的发送通知。
测试结果:WiFi下 收不到推送通知, 4G 可以接收到推送通知


(冷月轩) #4

还发现一个问题,当使用xcode运行ios上的应用时,可以正常接收通知,但是如果清空了后台后,重新再打开APP, 则接收不到推送通知了。不会触发receiveNotification


(冷月轩) #5


#6

WiFi 不行代表你们的 WiFi 有网络限制

这个测试,杀死后重启 App ,看下你的客户端日志的打印。并提供你设备的registrationID和你推送的消息的MessageID值,复制粘贴文本信息


(冷月轩) #7

RegistrationID: 18171adc035b3fab129
MessageID: 67553994564518013


#8

你消息的 alert 为空,消息不会展示

你发该消息时,App 处于前台吗?我查看该消息是成功发给了 Apple 服务器的,正常情况下他们是会发给设备的。

你的插件版本是多少?


(冷月轩) #9

对,APP是在前台运行,服务端为C# 设置的alert是为空,因为不需要显示,我把数据处理那块放在了receiveNotification ,处理完毕后我再发的是localnotification 进行提示,我的插件jpush-phonegap-plugin是 3.3.2 . 目前测试就是如果是用xcode 运行 ,就一切正常。但是如果这时杀掉后台,然后重新进APP,然后就收不到任何推送通知了


#10

你现在测试的是 4 G 吧?先根据这个 常见问题 - JPush 合集(持续更新) 排查一下,提供下你杀死后重启得到的客户端日志信息。


(HuminiOS) #11

确认一下是 receiveNotification 没有回调,还是 localnotification 没有触发。


(冷月轩) #12

这个我排除了一下,那个WIFI的问题可能跟我用的随身wifi有关,用无线路由器就没有问题. 针对不执行receiveNotification这个问题在无限路由器和4G 下都是一样。


(冷月轩) #13

我在receiveNotification回调的时候第一句就会执行alert(“received notification”)


(HuminiOS) #14

重启应用接收推送的日志提供一下。


(冷月轩) #15

log.rtf (190.2 KB)


(冷月轩) #16

log.rtf (190.2 KB)
这是杀死后启动后的日志


(HuminiOS) #17

真机调试一切正常是吧?


(冷月轩) #18

是的,真机 用xcode 运行就一切正常。非xcode运行,比如ionic cordova run ios运行,或者直接杀后台后,重新打开APP 就不行
iphone8 plus iOS 11.3.1


(HuminiOS) #19

重新运行时,app 在前台状态也收不到推送?如果在后台推送添加 alert 字段能有推送弹窗吗?


(冷月轩) #20

之前测试都是在前台运行状态下测试的,我现在试试将alert设置非空,看看会不会有回调,稍等2分钟