无法关闭推送
你的运行环境
- 插件版本: "jpush-react-native": "2.1.3","jcore-react-native": "1.2.2",
- react-native 版本:0.49.3
期望效果
能够自行关闭推送
实际效果
可以开启推送,但无法关闭推送,运行下面代码后还是能收到通知
//相关代码 if (Platform.OS == 'android'){ JPushModule.stopPush(); } else if(Platform.OS == 'ios') { JPushModule.removenetworkDidLoginListener(()=>{}) JPushModule.removeReceiveNotificationListener((map)=>{}) JPushModule.removeReceiveOpenNotificationListener((map)=>{}) JPushModule.removeOpenNotificationLaunchAppEventListener((map)=>{}) JPushModule.removeConnectionChangeListener((result)=>{}) DeviceEventEmitter.removeAllListeners(); NativeAppEventEmitter.removeAllListeners(); }
重现步骤
- ...
- ...
- ...
- ...
Debug logs
包括 Android 或 iOS 的日志:
android 还是 iOS?
@huangminlinux 两个都无法关闭
@zerotalk 我用 example 测试可以关闭,stopPush 后收不到通知。
没吊用