I have a super simple push notification receiver. I really just have the receiver setup in the AndroidManifest:
<!-- Listener to receive Push Notifications -->
<service
android:name="com.example.pushnotifications.receiver.PushMessageReceiver"
android:exported="false"
tools:ignore="InnerclassSeparator">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
And then the receiver class is just this:
class PushMessageReceiver : GcmListenerService() {
override fun onMessageReceived(from: String?, data: Bundle?) {
super.onMessageReceived(from, data)
// empty. only receives and displays standard push notification
}
}
In non-Oreo versions, this sends a push notification badge in the OS's notification bar, plays the default notification sound, and if you tap on the notification badge, the app opens.
That's really all I need at the moment. This works on non-Oreo versions, but nothing shows up on Oreo.
Any idea why this doesn't work anymore?