v/onsignal:找不到类,没有设置osremotenotificationReceivedReceivedHandler
按照 SDK 说明实现了代码部分,但在 android(Kotlin) 中接收单信号通知时未调用远程通知接收器。
清单声明
<meta-data
android:name="com.app.onesignal.NotificationServiceExtension"
android:value="com.app.view.services.NotificationServiceExtension" />
通知接收处理程序
class NotificationServiceExtension : OSRemoteNotificationReceivedHandler {
override fun remoteNotificationReceived(
context: Context,
notificationReceivedEvent: OSNotificationReceivedEvent
) {
val notification = notificationReceivedEvent.notification
notificationReceivedEvent.complete(mutableNotification)
}
}
Implemented the code part as per the SDK instructions but the remote notification receiver not getting called while receiving One-Signal notifications in android(Kotlin).
Manifest declaration
<meta-data
android:name="com.app.onesignal.NotificationServiceExtension"
android:value="com.app.view.services.NotificationServiceExtension" />
Notification receiver handler
class NotificationServiceExtension : OSRemoteNotificationReceivedHandler {
override fun remoteNotificationReceived(
context: Context,
notificationReceivedEvent: OSNotificationReceivedEvent
) {
val notification = notificationReceivedEvent.notification
notificationReceivedEvent.complete(mutableNotification)
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经更新了Meta-DATA通知服务扩展路径,它对我有用。
您必须按照一个信号SDK指令中提到的通知服务路径指定通知服务路径,然后起作用,否则通知接收器未初始化。
I have updated the meta-data notification service extension path and it is working for me.
You have to specify the notification service path as mentioned in the One signal SDK instructions then and then it works else the notification receiver is not initialized.