EmbeddedDistributorReceiver

UnifiedPush receiver for the Embedded distributor

Expose a receiver

You need to expose a Receiver that extend EmbeddedDistributorReceiver and you must override getEndpoint to return the address of your FCM rewrite-proxy.

class EmbeddedDistributor: EmbeddedDistributorReceiver() {
override fun getEndpoint(context: Context, fcmToken: String, instance: String): String {
// This returns the endpoint of your FCM Rewrite-Proxy
return "https://<your.domain.tld>/FCM?v2&instance=$instance&token=$token"
}
}

Edit your manifest

The receiver has to be exposed in the AndroidManifest.xml in order to receive the UnifiedPush messages.

<receiver android:enabled="true"  android:name=".EmbeddedDistributor" android:exported="false">
<intent-filter>
<action android:name="org.unifiedpush.android.distributor.feature.BYTES_MESSAGE"/>
<action android:name="org.unifiedpush.android.distributor.REGISTER"/>
<action android:name="org.unifiedpush.android.distributor.UNREGISTER"/>
</intent-filter>
</receiver>

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun getEndpoint(context: Context, token: String, instance: String): String

Returns the address of your FCM rewrite-proxy. You must override it.

Link copied to clipboard
open override fun onReceive(context: Context, intent: Intent)