尚未调用OneSignal.init。将订阅操作移至等待的任务队列

时间:2019-06-04 07:03:56

标签: android push-notification onesignal

我正在使用onesignal进行推送通知

implementation 'com.onesignal:OneSignal:[3.10.9, 3.99.99]'

下面在logcat中获取错误消息

 E/OneSignal: OneSignal.init has not been called. Moving subscription action to a waiting task queue.

我不是什么意思。

注意:我的设备也成功注册到一个信号中,并且也收到了通知。

但仍然收到错误消息

1 个答案:

答案 0 :(得分:0)

 Try to use this dependency hope it will help you

 implementation 'com.onesignal:OneSignal:3.10.6'

 Add the below code snippet if didn't either in application class 
 or inside main activity

 // OneSignal Initialization
    OneSignal.startInit(this)
        .setNotificationReceivedHandler(OneSignalNotificationReceiver(this))
        .setNotificationOpenedHandler(OneSignalNotificationOpened(this))
        .init()