PushService

abstract class PushService : Service

Service to receive UnifiedPush messages (new endpoints, unregistrations, push messages, errors) from the distributors

You need to declare a service that extend PushService. This service must not be exported and must handle the action org.unifiedpush.android.connector.PUSH_EVENT:

<service android:name=".PushServiceImpl"
android:exported="false">
<intent-filter>
<action android:name="org.unifiedpush.android.connector.PUSH_EVENT"/>
</intent-filter>
</service>

You need to use UnifiedPush to register for push notifications.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun onMessage(message: PushMessage, instance: String)

A new message is received. The message contains the decrypted content of the push message for the instance

Link copied to clipboard
abstract fun onNewEndpoint(endpoint: PushEndpoint, instance: String)

A new endpoint is to be used for sending push messages. The new endpoint should be send to the application server.

Link copied to clipboard
abstract fun onRegistrationFailed(reason: FailedReason, instance: String)

The registration is not possible, eg. no network, depending on the reason, you can try to register again directly.

Link copied to clipboard
open fun onTempUnavailable(instance: String)

The distributor backend is temporary unavailable.

Link copied to clipboard
abstract fun onUnregistered(instance: String)

This registration is unregistered by the distributor and won't receive push messages anymore.