Package 

Class MessagingReceiver


  • 
    public abstract class MessagingReceiver
    extends BroadcastReceiver
                        

    Deprecated, please use PushService instead.

    Receive UnifiedPush messages (new endpoints, unregistrations, push messages, errors) from the distributors

    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.

    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"/>
        </intent-filter>
    </receiver>
    • Method Summary

      Modifier and Type Method Description
      KeyManager getKeyManager(Context context) Define the KeyManager to use.
      abstract Unit onNewEndpoint(Context context, PushEndpoint endpoint, String instance) A new endpoint is to be used for sending push messages.
      abstract Unit onRegistrationFailed(Context context, FailedReason reason, String instance) The registration is not possible, eg.
      abstract Unit onUnregistered(Context context, String instance) This application is unregistered by the distributor from receiving push messages
      abstract Unit onMessage(Context context, PushMessage message, String instance) A new message is received.
      Unit onReceive(Context context, Intent intent) Handle UnifiedPush messages, should not be override
      • Methods inherited from class org.unifiedpush.android.connector.MessagingReceiver

        abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, getSentFromPackage, getSentFromUid, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait