Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
caoxiemeihao opened this issue Jan 24, 2019 · 7 comments

Comments

@caoxiemeihao
Copy link

caoxiemeihao commented Jan 24, 2019

你的运行环境

➜  node -v
v10.15.0
➜  npm -v
6.4.1
  • 插件版本:
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-ionic-webview" spec="^2.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.1" />
<plugin name="cordova-plugin-camera" spec="^4.0.3" />
<plugin name="cordova-plugin-telerik-imagepicker" spec="^2.2.2" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="cordova.plugins.diagnostic" spec="^4.0.10" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-screen-orientation" spec="^3.0.1" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="jpush-phonegap-plugin" spec="^3.6.2">
    <variable name="APP_KEY" value="*********** My appKey ***********" />
    <variable name="CHANNEL" value="developer-default" />
</plugin>
  • 平台(Android / iOS):

ios iphone-x 12.1
Xcode Version 10.1 (10B61)

  • Cordova version (cordova -v):
➜  cordova -v
8.1.2 ([email protected])
  • Cordova platform version (cordova platform ls):
➜  cordova platform --list
Installed platforms:
  ios 4.5.5
Available platforms:
  android ~7.1.1
  browser ~5.0.1
  osx ~4.0.1
  windows ~6.0.0
  • Ionic Version (if using Ionic)
➜  ionic --version
4.7.1

期望效果

  • 点击通知后,无论是直接开启app还是从后台进入app,都能够触发 jpush.openNotification 事件。

实际效果

  • 点击通知后,直接开启app能够触发 jpush.openNotification 事件。当app在后台时,从后台进入app,appjpush.openNotification 事件不触发。

重现步骤

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

背景

测试如下版本均是如此

  • jpush-phonegap-plugin-3.4.3
  • jpush-phonegap-plugin-3.4.5
  • jpush-phonegap-plugin-3.4.7
  • jpush-phonegap-plugin-3.5.0
  • jpush-phonegap-plugin-3.6.2

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
Copy link
Contributor

测试设备是 iOS 几?

@caoxiemeihao
Copy link
Author

测试设备是 iOS 几?

Iphone-x
ios 12.1

@galaxypan
Copy link

这个问题好像还是存在的

@DarrenHou1993
Copy link

官方不维护了吗?

@liulangqishi
Copy link

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

@DarrenHou1993
Copy link

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

@liulangqishi
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants