jpush / jpush/jpush-react-native
jpush-react-native@2.5.10 iOS能收到推送通知,但无法触发JS事件回调
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 348
- PR merge metrics
- No merged PRs in 30d
Description
运行环境
- 插件版本:
"jcore-react-native": "^1.3.7",
"jpush-react-native": "^2.5.10", - react-native 版本:0.59.8
- xcode 11
- iOS 12 & iOS 13
期望效果
实际效果
iOS能正常收到推送通知,前台能弹出通知,但无法触发JS事件回调,DevTools控制台无输出。
自定义消息能正常接收,并正确触发JS回调,DevTools控制台有console.log()输出。
iOS 12 & iOS 13下
无论APP处于前台运行、后台或杀死进程,都能正常弹出推送通知。
但都无法触发addNotificationListener回调。
js监听代码如下:
JPush.addConnectEventListener((result) => {
console.log(`connectListener: ${JSON.stringify(result)}`)
})
JPush.addNotificationListener((result) => {
console.log(`notificationListener: ${JSON.stringify(result)}`)
})
JPush.addCustomMessagegListener((result) => {
console.log(`customMessageListener: ${JSON.stringify(result)}`)
})
PS: Android接入正常
重现步骤
按照最新的样例配置
https://github.com/jpush/jpush-react-native/blob/master/example/ios/example/AppDelegate.m
Debug logs
包括 Android 或 iOS 的日志:
debug日志正常,正确连接APNS,正确获取 deviceToken
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.
Research direction
Start with the iOS integration in example/ios/example/AppDelegate.m and compare the addNotificationListener path with the working addCustomMessagegListener path. Reproduce on the listed React Native, plugin, Xcode, and iOS versions; done means iOS notification pushes trigger the JavaScript notification callback in foreground, background, and terminated states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100