我使用的极光ionic插件cordova-plugin-jcore@1.1.12,jpush-phonegap-plugin@3.3.2。在ios10.3.3上,当app处于运行状态,不能收到推送消息。按home键,app转到后台,可收到消息。完全删除程序,也可以收到推送消息

标签: #<Tag:0x00007f657b0cc780> #<Tag:0x00007f657b0cc4d8> #<Tag:0x00007f657b0cc230>

我使用的极光ionic插件cordova-plugin-jcore@1.1.12,jpush-phonegap-plugin@3.3.2。在ios10.3.3上,当app处于运行状态,不能收到推送消息。按home键,app转到后台,可收到消息。完全删除程序,也可以收到推送消息

iOS 10 以上是支持的,

建议版本都升级到最新的版本

您所说的最新版本的版本号是多少?

v3.6.4

依然有这个问题

cordova-plugin-jcore" spec="^1.1.12"
name=“jpush-phonegap-plugin” spec="^3.6.4">
name=“APP_KEY” value=“69af13600b968c897d979941”
name=“CHANNEL” value=“developer-default”

你是否有实现相关方法?

如果没有实现,不应该是只在app处于前台的时候才收不到,应该怎么都收不到。控制台有提示‘不是合法的APP_KEY’,APP_KEY是我从极光-应用设置中获得的,我比对了,是一样的。这是完整提示:‘
2019-07-09 17:48:45.932071+0800 牛斯达克 [6472:2332628] | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey: channel:channel name isProduction:FALSE advertisingIdentifier:

2019-07-09 17:48:45.934412+0800 牛斯达克 [6472:2332627] | JIGUANG | E - [JIGUANGAlert] ERROR

“” 不是合法的 APP_KEY

(有关 APP_KEY 的说明请参考开发文档 “SDK 集成指南 https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/

2019-07-09 17:48:45.934591+0800 牛斯达克 [6472:2332627] | JIGUANG | E - [JIGUANGService] 请检查 "setupWithOption:appKey:channel:apsForProduction:" 方法的参数值

2019-07-09 17:48:46.058004+0800 牛斯达克[6472:2332627] | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <e32b7cea 662226e4 5c83fc66 7ee969dc 3b639d52 1f1e6bd1 a7d4ab43 0718cf0d>

我在JPushConfig.plist中将appkey添加进去,‘ 不是合法的 APP_KEY’的提示已不再有,但问题依然没有解决。当app处于前台时,不能接收到信息。app处于后台,或完全退出app,可以收到消息。

1、提供全量的 log,从初始化到你发了消息之后

2、前台收到推送和后台收到的不是一样的方法

2019-07-10 10:49:25.023077+0800 牛斯达克 [6825:2396448] Apache Cordova native platform version 4.5.5 is starting.

2019-07-10 10:49:25.024744+0800 牛斯达克 [6825:2396448] Multi-tasking -> Device: YES, App: YES

2019-07-10 10:49:25.049481+0800 牛斯达克 [6825:2396448] CDVWKWebViewEngine: trying to inject XHR polyfill

2019-07-10 10:49:25.172464+0800 牛斯达克 [6825:2396448] CDVWKWebViewEngine will reload WKWebView if required on resume

2019-07-10 10:49:25.172850+0800 牛斯达克 [6825:2396448] Using Ionic WKWebView

2019-07-10 10:49:25.174097+0800 牛斯达克 [6825:2396448] [CDVTimer][console] 0.169992ms

2019-07-10 10:49:25.174472+0800 牛斯达克 [6825:2396448] [CDVTimer][handleopenurl] 0.213027ms

2019-07-10 10:49:25.179660+0800 牛斯达克 [6825:2396448] [CDVTimer][intentandnavigationfilter] 5.110979ms

2019-07-10 10:49:25.179941+0800 牛斯达克 [6825:2396448] [CDVTimer][gesturehandler] 0.159025ms

2019-07-10 10:49:25.180241+0800 牛斯达克 [6825:2396448] CDVIonicKeyboard: resize mode 1

2019-07-10 10:49:25.181866+0800 牛斯达克 [6825:2396448] [CDVTimer][keyboard] 1.749039ms

2019-07-10 10:49:25.202539+0800 牛斯达克 [6825:2396448] [CDVTimer][splashscreen] 20.527959ms

2019-07-10 10:49:25.217366+0800 牛斯达克 [6825:2396448] [CDVTimer][statusbar] 14.603019ms

2019-07-10 10:49:25.217521+0800 牛斯达克 [6825:2396448] [CDVTimer][TotalPluginStartup] 43.745995ms

2019-07-10 10:49:25.253096+0800 牛斯达克 [6825:2396499] | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:69af13600b968c897d979941 channel:channel name isProduction:FALSE advertisingIdentifier:

2019-07-10 10:49:25.257846+0800 牛斯达克 [6825:2396501] | JIGUANG | I - [JIGUANGService]

--------------------------- JPush Log ----------------------------

--------------------JPush SDK Version:3.0.7–build:45----------

--------------------JCore Lib Version:1.1.6–build:29----------

-----------------AppKey:69af13600b968c897d979941----------------

----------------------------------------------------------------

2019-07-10 10:49:25.261457+0800 牛斯达克 [6825:2396501] | JIGUANG | I - [JIGUANGClientController] Action - jpush setup

2019-07-10 10:49:25.263844+0800 牛斯达克 [6825:2396501] | JIGUANG | I - [JIGUANGClientController] Action - setup

2019-07-10 10:49:25.462572+0800 牛斯达克 [6825:2396499] | JIGUANG | W - [JIGUANGService] 请将 JPush 的初始化方法,添加到 [UIApplication application: didFinishLaunchingWithOptions:] 方法中,否则 JPush 将不能准确的统计到通知的点击数量。参考文档: https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6

2019-07-10 10:49:25.463501+0800 牛斯达克 [6825:2396499] | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <a6009876 386c0440 8b44c12f 496c690d 0f8e631b 7eaab513 c909096f e800995a>

2019-07-10 10:49:25.561620+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGPageFlow] trySetupSession

2019-07-10 10:49:25.564345+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGPageFlow] setupSession

2019-07-10 10:49:25.638086+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGUserActiveReport] report content {

activities = (

);

date = “2019-07-10”;

duration = 124;

itime = 1562726416;

"session_id" = e5544151f3e968c0cf6ca612833878d0;

time = “10:40:16”;

timezone = “+8”;

type = “active_terminate”;

}

2019-07-10 10:49:25.702159+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession

2019-07-10 10:49:25.703823+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGPageFlow] setupSession

2019-07-10 10:49:25.705152+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGPageFlow] resetCurrentPage

2019-07-10 10:49:25.707341+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - a6009876386c04408b44c12f496c690d0f8e631b7eaab513c909096fe800995a

2019-07-10 10:49:25.709170+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession

2019-07-10 10:49:25.710217+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession

2019-07-10 10:49:25.713013+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1, curNetworkStatus: 2

2019-07-10 10:49:25.715738+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)

2019-07-10 10:49:25.717634+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - connect

2019-07-10 10:49:25.719052+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect

2019-07-10 10:49:25.722239+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGSessionController] sis is not on protect

2019-07-10 10:49:25.723665+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache

2019-07-10 10:49:25.726883+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGAddressController] 开始 Sis 解析

2019-07-10 10:49:25.733196+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest

2019-07-10 10:49:25.979543+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGAddressController] get address :121.46.30.59 from host : s.jpush.cn

2019-07-10 10:49:25.981112+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest:toDefaultPort

2019-07-10 10:49:25.982982+0800 牛斯达克 [6825:2396501] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:

2019-07-10 10:49:25.995442+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGUdpSocket] send udp data

2019-07-10 10:49:25.997078+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed

2019-07-10 10:49:25.999309+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior

2019-07-10 10:49:26.158778+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGAddressController] Action - parse

2019-07-10 10:49:26.216799+0800 牛斯达克 [6825:2396542] | JIGUANG | D - [JIGUANGAddressController] Action - parse ips address

2019-07-10 10:49:26.342722+0800 牛斯达克 [6825:2396542] | JIGUANG | D - [JIGUANGAddressController] Action - parseOptionAddress

2019-07-10 10:49:26.462135+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:

2019-07-10 10:49:26.464411+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGAddressController] receive sis result

2019-07-10 10:49:26.465552+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp

2019-07-10 10:49:26.466660+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:

2019-07-10 10:49:26.467842+0800 牛斯达克 [6825:2396542] | JIGUANG | D - [JIGUANGSessionController] connectTcp:43.247.88.99:7011

2019-07-10 10:49:26.468749+0800 牛斯达克 [6825:2396542] | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 43.247.88.99,port 7011

2019-07-10 10:49:26.661687+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGAddressController] Action - sisReport:port

2019-07-10 10:49:26.668691+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGTcpSocket] 连接主机成功

2019-07-10 10:49:26.672240+0800 牛斯达克 [6825:2396542] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidSetupNotification (null)

2019-07-10 10:49:26.779740+0800 牛斯达克 [6825:2396500] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest

2019-07-10 10:49:26.937503+0800 牛斯达克 [6825:2396502] | JIGUANG | I - [JIGUANGLogin]

----- login result -----

uid:28315535947

registrationID:141fe1da9ed0147430e

2019-07-10 10:49:26.938570+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command

2019-07-10 10:49:26.939581+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:

2019-07-10 10:49:26.942042+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond

2019-07-10 10:49:26.948827+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null)

2019-07-10 10:49:27.135031+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGReport] send report:(

{

date = “2019-07-10”;

itime = 1562726965;

"session_id" = 5fefea233edd16a618036560d25c105d;

time = “10:49:25”;

timezone = “+8”;

type = “active_launch”;

}

) log succed

2019-07-10 10:49:27.712470+0800 牛斯达克 [6825:2396546] | JIGUANG | D - [JIGUANGReport] send report:(

{

activities = (

);

date = “2019-07-10”;

duration = 124;

itime = 1562726416;

"session_id" = e5544151f3e968c0cf6ca612833878d0;

time = “10:40:16”;

timezone = “+8”;

type = “active_terminate”;

}

) log succed

2019-07-10 10:49:29.955223+0800 牛斯达克 [6825:2396448] Ionic Native: deviceready event fired after 3338 ms

2019-07-10 10:49:30.003115+0800 牛斯达克 [6825:2396448] ### pluginInitialize

2019-07-10 10:49:30.708309+0800 牛斯达克 [6825:2396542] | JIGUANG | D - [JIGUANGService] Action - registrationID

2019-07-10 10:49:30.729334+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest

2019-07-10 10:49:31.505313+0800 牛斯达克 [6825:2396502] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command

可以帮我看下日志,分析下原因吗?

你的日志里面原生的版本,和插件最新版本里面用的 原生 SDK 版本并不一致

插件 JPush 3.6.4、JCore 1.2.8 版本 中用到的最新原生 SDK 是 JPush 3.1.2 和 JCore 1.2.6

这是最新的插件的日志,依然不行。
2019-07-15 15:22:03.825217+0800 牛斯达克 [861:247097] | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:69af13600b968c897d979941 channel:channel name isProduction:FALSE advertisingIdentifier:

2019-07-15 15:22:03.828813+0800 牛斯达克 [861:247098] | JIGUANG | I - [JIGUANGService]

--------------------------- JPush Log ----------------------------

--------------------JPush SDK Version:3.1.2–build:71----------

--------------------JCore Lib Version:1.2.6–build:68----------

-----------------AppKey:69af13600b968c897d979941----------------

----------------------------------------------------------------

2019-07-15 15:22:03.838121+0800 牛斯达克 [861:247097] | JIGUANG | I - [JIGUANGClientController] Action - jpush setup

2019-07-15 15:22:03.838385+0800 牛斯达克 [861:247097] | JIGUANG | I - [JIGUANGClientController] Action - setup

2019-07-15 15:22:04.006074+0800 牛斯达克 [861:247100] | JIGUANG | W - [JIGUANGService] 请将 JPush 的初始化方法,添加到 [UIApplication application: didFinishLaunchingWithOptions:] 方法中,否则 JPush 将不能准确的统计到通知的点击数量。参考文档: https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6

2019-07-15 15:22:04.006254+0800 牛斯达克 [861:247100] | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <8a417c3a 4699287c 90e78441 2dc65663 0d5213b8 c968bcdf 2bcc3f25 4a1f3a71>

2019-07-15 15:22:04.132616+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGPageFlow] trySetupSession

2019-07-15 15:22:04.134112+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGPageFlow] setupSession

2019-07-15 15:22:04.233083+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession

2019-07-15 15:22:04.234593+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession

2019-07-15 15:22:04.235253+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1

2019-07-15 15:22:04.235961+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)

2019-07-15 15:22:04.236741+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGSessionController] Action - connect

2019-07-15 15:22:04.237323+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect

2019-07-15 15:22:04.238075+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGSessionController] sis is not on protect

2019-07-15 15:22:04.238925+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache

2019-07-15 15:22:04.239653+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGAddressController] 开始 Sis 解析

2019-07-15 15:22:04.242686+0800 牛斯达克 [861:247102] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest

2019-07-15 15:22:04.250651+0800 牛斯达克 [861:247097] | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 8a417c3a4699287c90e784412dc656630d5213b8c968bcdf2bcc3f254a1f3a71

2019-07-15 15:22:04.253230+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGAddressController] get address :43.247.88.106 from host : s.jpush.cn

2019-07-15 15:22:04.253824+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGTcpAddressSis] Action - sendSisRequest:toDefaultPort:toCustomPort

2019-07-15 15:22:04.254216+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:

2019-07-15 15:22:04.265703+0800 牛斯达克 [861:247100] | JIGUANG | D - [JIGUANGUdpSocket] send udp data

2019-07-15 15:22:04.266553+0800 牛斯达克 [861:247100] | JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed

2019-07-15 15:22:04.268484+0800 牛斯达克 [861:247100] | JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior

2019-07-15 15:22:04.347359+0800 牛斯达克 [861:247101] | JIGUANG | D - [JIGUANGTcpAddressSis] Action - parse

2019-07-15 15:22:04.670591+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGTcpAddressSis] Action - parse ips address

2019-07-15 15:22:04.764774+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGTcpAddressSis] Action - parseOptionAddress

2019-07-15 15:22:04.866449+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:

2019-07-15 15:22:04.867352+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGSessionController] current network, ipv4

2019-07-15 15:22:04.867509+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp

2019-07-15 15:22:04.867600+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:

2019-07-15 15:22:04.867685+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGSessionController] connectTcp:121.46.20.57:7009

2019-07-15 15:22:04.867768+0800 牛斯达克 [861:247098] | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 121.46.20.57,port 7009

2019-07-15 15:22:04.934592+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGTcpSocket] 连接主机成功

2019-07-15 15:22:04.934826+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGTcpAddressSis] Action - sisReport:port

2019-07-15 15:22:04.934937+0800 牛斯达克 [861:247098] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidSetupNotification (null)

2019-07-15 15:22:05.051328+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest

2019-07-15 15:22:05.109133+0800 牛斯达克 [861:247099] | JIGUANG | I - [JIGUANGLogin]

----- login result -----

uid:28726405331

registrationID:161a3797c87db2b5fd0

idc:1

2019-07-15 15:22:05.109345+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command

2019-07-15 15:22:05.109434+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:

2019-07-15 15:22:05.109519+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond

2019-07-15 15:22:05.114098+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null)

2019-07-15 15:22:08.550799+0800 牛斯达克 [861:247097] | JIGUANG | D - [JIGUANGService] Action - resetBadge

2019-07-15 15:22:08.813776+0800 牛斯达克 [861:247097] | JIGUANG | I - [JIGUANGBadgeNumberReport] set badge:0 succeed

2019-07-15 15:22:10.271734+0800 牛斯达克 [861:247099] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command

你在前台有清除了角标吗?把 清除角标的代码先去掉看下呢?

看看有没有更多的日志,是收到了消息但没展示出来,还是完全没收到。

插件测试正常,且我查看你官网推送的消息都是成功发出了的

或者你换一个手机测试呢?
方法是否使用正确

1.把清除角标的代码去掉,不能收到通知
2.app处于前台时,完全没有收到消息,也没有打印日志
3.换了其他手机,同样的问题
4.接收通知的方法写了,执行了,网页端发送‘通知’时没有被调用。
5.网页端发送‘自定义消息’时,有日志打印,监听方法也能正常触发。

还有什么其他可能性?

请你这边测试一下:
在后台能收到消息后,应用切到前台,再推送能不能收到。

如果不能收到,提供整个过程sdk的日志:应用后台收到消息-转到前台-potal端下发消息

TXT 文件提供。

感谢您的回复!

目前更换了极光账号。

这是最新的日志jpush日志.txt (28.9 KB)

应用前台收不到消息,可以在集成的时候参考下面代码completionHandler()的配置

* (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) { [JPUSHService handleRemoteNotification:userInfo]; }UIAlertView *test = [[UIAlertView alloc] initWithTitle:@"willPresent"
message:@"tt"
delegate:self
cancelButtonTitle:@"yes"
otherButtonTitles:nil, nil];
[test show];
[rootViewController addNotificationCount];
// test function
NSNotificationCenter *noti = [NSNotificationCenter defaultCenter];
[noti postNotificationName:@"testRemoteNotification"
object:self
userInfo:userInfo];
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert);
}

未触发jpush.openNotification事件在log日志中有体现:

请将JPush的初始化方法,添加到[UIApplication application: didFinishLaunchingWithOptions:]方法中,否则JPush将不能准确的统计到通知的点击数量。参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6