public interface PushCallback

This callback interface is invoked when a push notification is received by the application. If the main class of the application implements push callback it will receive push notification calls from the system. Notice that its very possible that a separate instance of the main class will be created to perform the push!

Fields

public static final int REGISTRATION_ERROR_SERVICE_NOT_AVAILABLE = 1Error code returned when sending a push notification
public static final int REGISTRATION_ACCOUNT_MISSING = 2Error code returned when sending a push notification
public static final int REGISTRATION_AUTHENTICATION_FAILED = 3Error code returned when sending a push notification
public static final int REGISTRATION_TOO_MANY_REGISTRATIONS = 4Error code returned when sending a push notification
public static final int REGISTRATION_INVALID_SENDER = 5Error code returned when sending a push notification
public static final int REGISTRATION_PHONE_REGISTRATION_ERROR = 6Error code returned when sending a push notification

Methods

public abstract void push(String value)Invoked when the push notification occurs
public abstract void registeredForPush(String deviceId)Invoked when push registration is complete to pass the device ID to the application.
public abstract void pushRegistrationError(String error, int errorCode)Invoked to indicate an error occurred during registration for push notification

Field details

REGISTRATION_ERROR_SERVICE_NOT_AVAILABLE

public static final int REGISTRATION_ERROR_SERVICE_NOT_AVAILABLE = 1
Error code returned when sending a push notification

REGISTRATION_ACCOUNT_MISSING

public static final int REGISTRATION_ACCOUNT_MISSING = 2
Error code returned when sending a push notification

REGISTRATION_AUTHENTICATION_FAILED

public static final int REGISTRATION_AUTHENTICATION_FAILED = 3
Error code returned when sending a push notification

REGISTRATION_TOO_MANY_REGISTRATIONS

public static final int REGISTRATION_TOO_MANY_REGISTRATIONS = 4
Error code returned when sending a push notification

REGISTRATION_INVALID_SENDER

public static final int REGISTRATION_INVALID_SENDER = 5
Error code returned when sending a push notification

REGISTRATION_PHONE_REGISTRATION_ERROR

public static final int REGISTRATION_PHONE_REGISTRATION_ERROR = 6
Error code returned when sending a push notification

Method details

push

public abstract void push(String value)
Invoked when the push notification occurs

Parameters

value String
the value of the push notification

registeredForPush

public abstract void registeredForPush(String deviceId)
Invoked when push registration is complete to pass the device ID to the application.

Parameters

deviceId String
OS native push id you should not use this value and instead use Push.getPushKey()

pushRegistrationError

public abstract void pushRegistrationError(String error, int errorCode)
Invoked to indicate an error occurred during registration for push notification

Parameters

error String
descriptive error string
errorCode int
an error code