MessagingReceiver
Deprecated, please use PushService instead.
Receive UnifiedPush messages (new endpoints, unregistrations, push messages, errors) from the distributors
Deprecation note
The library already embed a receiver implementing this receiver and forward the events to a service. This allow us to maintain the declaration of the exposed service, which can make maintenance easier if any change is required in the future.
It is still possible to use this receiver directly: if a receiver with this intent filter is declared in your manifest, the one declared in the library won't run.
Expose this receiver
The receiver has to be exposed in the AndroidManifest.xml
in order to receive the UnifiedPush messages.
<receiver android:exported="true" android:enabled="true" android:name=".CustomReceiver">
<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.TEMP_UNAVAILABLE"/>
</intent-filter>
</receiver>
Functions
Define the KeyManager to use. DefaultKeyManager by default.
A new message is received. The message contains the decrypted content of the push message for the instance
A new endpoint is to be used for sending push messages. The new endpoint should be send to the application server.
The registration is not possible, eg. no network, depending on the reason, you can try to register again directly.
The distributor backend is temporary unavailable.
This registration is unregistered by the distributor and won't receive push messages anymore.