iOS设备在接收到一条推送通知时多次运行NativeAppEventEmitter.addListener('ReceiveNotification', )
iOS设备在接收到一条推送通知时多次重复运行NativeAppEventEmitter.addListener('ReceiveNotification', (notification)=>{console.log("推送通知");console.log(notification);})(Android端那三个函数没问题) 而我希望的是接收到一条推送消息就运行一次NativeAppEventEmitter.addListener('ReceiveNotification', (notification)=>{console.log("推送通知");console.log(notification);})
这算BUG吗
有在componentWillUnmount函数中调用 remove方法吗?
@huangminlinux 这个问题可能是在调试的时候出现异常退出,没调用到componentWillUnmount下一次启动就会增加一次调用ReceiveNotification方法,这里有没有什么办法可以在异常退出前调用remove结束它的周期,使其不会对下一次调用NativeAppEventEmitter.addListener('ReceiveNotification', ***)造成影响
讲道理第二次启动不会受第一次设置的影响
谢谢,异常我再这里再处理一下吧