jpush / jpush-phonegap-plugin

JPush's officially supported PhoneGap/Cordova plugin (Android & iOS). 极光推送官方支持的 PhoneGap/Cordova 插件(Android & iOS)。
https://docs.jiguang.cn
MIT License
926 stars 350 forks source link

ios jpush.openNotification 事件。点击通知打开app时能触发,从后台进入app时不能触发。 #392

Open caoxiemeihao opened 5 years ago

caoxiemeihao commented 5 years ago

你的运行环境

➜  node -v
v10.15.0
➜  npm -v
6.4.1

期望效果

实际效果

重现步骤

  1. 开启app
  2. 返回home页面,等待通知
  3. 收到通知后,点击通知会进入app
  4. 预先定义的 jpush.openNotification 事件不会触发

背景

测试如下版本均是如此

Debug logs

Xcode 日志如下

| JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:******** My appKey ******** channel:channel name isProduction:FALSE advertisingIdentifier:
| JIGUANG | I - [JIGUANGService] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.1.2--build:71----------
--------------------JCore Lib Version:1.2.6--build:68----------
-----------------AppKey:*********** My appKey ***********----------------
----------------------------------------------------------------
| JIGUANG | I - [JIGUANGClientController] Action - jpush setup
| JIGUANG | I - [JIGUANGClientController] Action - setup
| JIGUANG | E - [JIGUANGClientController] load aps evi error, no em provision url
| JIGUANG | D - [JIGUANGPageFlow] trySetupSession
| JIGUANG | D - [JIGUANGPageFlow] setupSession
| JIGUANG | W - [JIGUANGService] 请将JPush的初始化方法,添加到[UIApplication application: didFinishLaunchingWithOptions:]方法中,否则JPush将不能准确的统计到通知的点击数量。参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6
| JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <06d111fd 65d89fb0 bcb09d13 ed12d50d 720c1ae2 06b09300 74fc1cde 0140a490>
| JIGUANG | D - [JIGUANGUserActiveReport] report content {
    date = "2019-01-24";
    duration = "331.1";
    itime = 1548316739;
    "session_id" = 5a8e1553e35b904bd8172138ca555ff7;
    time = "15:23:11";
    timezone = "+8";
    type = "active_terminate";
}
| JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
| JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession
| JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
| JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1
| JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
| JIGUANG | D - [JIGUANGSessionController] Action - connect
| JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
| JIGUANG | D - [JIGUANGSessionController] sis is not on protect
| JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
| JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
| JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
| JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 06d111fd65d89fb0bcb09d13ed12d50d720c1ae206b0930074fc1cde0140a490
| JIGUANG | D - [JIGUANGAddressController] get address :124.202.138.29 from host : s.jpush.cn
| JIGUANG | D - [JIGUANGTcpAddressSis] Action - sendSisRequest:toDefaultPort:toCustomPort
| JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
| JIGUANG | D - [JIGUANGUdpSocket] send udp data
| JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed
| JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior
| JIGUANG | D - [JIGUANGTcpAddressSis] Action - parse
| JIGUANG | D - [JIGUANGTcpAddressSis] Action - parse ips address
| JIGUANG | D - [JIGUANGTcpAddressSis] Action - parseOptionAddress
| JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
| JIGUANG | D - [JIGUANGSessionController] current network, ipv4
| JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
| JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
| JIGUANG | D - [JIGUANGSessionController] connectTcp:43.247.88.100:7002
| JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 43.247.88.100,port 7002
| JIGUANG | D - [JIGUANGReport] send report:(
        {
        date = "2019-01-24";
        duration = "331.1";
        itime = 1548316739;
        "session_id" = 5a8e1553e35b904bd8172138ca555ff7;
        time = "15:23:11";
        timezone = "+8";
        type = "active_terminate";
    }
) log succed
| JIGUANG | D - [JIGUANGReport] send report:(
        {
        date = "2019-01-24";
        itime = 1548316739;
        "session_id" = 925589a515ee9ed9af03c847603a90fe;
        time = "15:58:59";
        timezone = "+8";
        type = "active_launch";
    }
) log succed
| JIGUANG | D - [JIGUANGTcpAddressSis] Action - sisReport:port
| JIGUANG | D - [JIGUANGTcpSocket] 连接主机成功
| JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidSetupNotification (null)
| JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest
| JIGUANG | I - [JIGUANGLogin] 
----- login result -----
uid:20428629637 
registrationID:141fe1da9ef575fafc0 
idc:0
| JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
| JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:
| JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond
| JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null)
| JIGUANG | D - [JIGUANGService] Action - setDebugMode
| JIGUANG | D - [JIGUANGService] Action - registrationID
huangminlinux commented 5 years ago

测试设备是 iOS 几?

caoxiemeihao commented 5 years ago

测试设备是 iOS 几?

Iphone-x ios 12.1

galaxypan commented 5 years ago

这个问题好像还是存在的

DarrenHou1993 commented 5 years ago

官方不维护了吗?

liulangqishi commented 3 years ago

jpush-phonegap-plugin-3.7.6 也有同样的现象

DarrenHou1993 commented 3 years ago

该问题目前我自己找到了解决方案,已经提交PR了 #433 但是未被处理呢。 需要的可以自己改下源码。

liulangqishi commented 3 years ago

该问题目前我自己找到了解决方案,已经提交PR了 #433 但是未被处理呢。 需要的可以自己改下源码。

我按照 内容修改后,还是 无法触发,是不是有其他地方有影响呢?