Android端推送的消息可以立马收到,代码中却无法回调

zhangdaren11
2017-11-03 03:34 2k 0

如题,通知栏显示推送,代码中的回调函数却没有反应:比如:

componentDidMount() {

        //接收推送事件
        JPushModule.addReceiveNotificationListener((message) => {

            this._showInfo("接收推送事件:"+message.alertContent);//显示弹窗
            console.log("接收推送事件");
        })

        // 打开通知
        JPushModule.addReceiveOpenNotificationListener((map) => {
            this._showInfo("打开通知:"+map.alertContent );
            console.log("打开通知");

        });

    }

    componentWillUnmount() {
        JPushModule.removeReceiveCustomMsgListener();
        JPushModule.removeReceiveNotificationListener();
    }

推送的消息可以立马收到,但接收到无反应,点击通知栏的消息,消息消失,无反应,log也不打印

2个回答

热门排序