Android 未调用接收到的Onesignal远程通知方法
我想在我的数据库中保存通知,所以我从这里开始遵循文档的两个步骤 但根本不调用remoteNotificationReceived方法。 我使用了SetNotificationWillShowInformeGroundHandler,如下所示,它可以工作,但我希望即使应用程序在后台也能收到通知Android 未调用接收到的Onesignal远程通知方法,android,android-studio,kotlin,onesignal,Android,Android Studio,Kotlin,Onesignal,我想在我的数据库中保存通知,所以我从这里开始遵循文档的两个步骤 但根本不调用remoteNotificationReceived方法。 我使用了SetNotificationWillShowInformeGroundHandler,如下所示,它可以工作,但我希望即使应用程序在后台也能收到通知 OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent -> { // not c
OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent -> {
// not called while in background
});
我还应该提到推送通知工作正常,我在设备上收到通知您需要为后台通知处理添加实现 查看下面的文档链接
- 一般处理:
- 后台通知处理:
我正在使用NotificationExtender服务,它工作得很好。我通过在一个空的单独类中实现OSRemoteNotificationReceivedHandler来解决这个问题。谢谢你的回答,但我已经解决了