ios jpush.openNotification 事件。点击通知打开app时能触发,从后台进入app时不能触发。
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ios, javascript
- Domain
- mobile
Research direction
Start by reproducing the iOS lifecycle case with jpush.openNotification: compare launching the app from a notification with returning to it from the background. Review the plugin’s notification and app-lifecycle entry points, using the listed Cordova, iOS, and JPush versions as context. Done means the event fires in both launch paths and the existing behavior is covered by verification.
Written by the indexing model from the issue text.
Description
你的运行环境
➜ 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
XcodeVersion 10.1 (10B61)
- Cordova version (
cordova -v):
➜ cordova -v
8.1.2 (cordova-lib@8.1.1)
- 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 事件不触发。
重现步骤
- 开启app
- 返回home页面,等待通知
- 收到通知后,点击通知会进入app
- 预先定义的 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
- Dominant language
- JavaScript
- Stars
- 922
- Forks
- 350
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jpush/jpush-phonegap-plugin
-
Difficulty 3/5 1-2 days Newbie friendliness 15/100
jpush/jpush-phonegap-plugin#472 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
jpush/jpush-phonegap-plugin#470 ·
-
5.2.0版本在安卓中编译报错 Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
jpush/jpush-phonegap-plugin#469 ·
-
安装插件报错 Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
jpush/jpush-phonegap-plugin#464 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
jpush/jpush-phonegap-plugin#463 ·
All issues in jpush/jpush-phonegap-plugin
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100