Introduce PushMessageReceiver and set up manifest.

This commit is contained in:
KotlinGeekDev
2023-10-12 19:48:54 +01:00
parent f68f32f942
commit 18931fb743
2 changed files with 50 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".Amethyst">
<receiver
android:exported="true"
android:enabled="true"
android:name=".service.notifications.PushMessageReceiver">
<intent-filter>
<action android:name="org.unifiedpush.android.connector.MESSAGE"/>
<action android:name="org.unifiedpush.android.connector.UNREGISTERED"/>
<action android:name="org.unifiedpush.android.connector.NEW_ENDPOINT"/>
<action android:name="org.unifiedpush.android.connector.REGISTRATION_FAILED"/>
<action android:name="org.unifiedpush.android.connector.REGISTRATION_REFUSED"/>
</intent-filter>
</receiver>
</application>
</manifest>
@@ -0,0 +1,27 @@
package com.vitorpamplona.amethyst.service.notifications
import android.content.Context
import android.content.Intent
import org.unifiedpush.android.connector.MessagingReceiver
class PushMessageReceiver: MessagingReceiver() {
override fun onMessage(context: Context, message: ByteArray, instance: String) {
super.onMessage(context, message, instance)
}
override fun onNewEndpoint(context: Context, endpoint: String, instance: String) {
super.onNewEndpoint(context, endpoint, instance)
}
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
}
override fun onRegistrationFailed(context: Context, instance: String) {
super.onRegistrationFailed(context, instance)
}
override fun onUnregistered(context: Context, instance: String) {
super.onUnregistered(context, instance)
}
}