V/OneSignal: No class found, not setting up OSRemoteNotificationReceivedHandler

Viewed 415

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)

          }
}
1 Answers

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.

<meta-data
            android:name="com.onesignal.NotificationServiceExtension"
            android:value="com.app.view.services.NotificationServiceExtension" />
Related