Package com.batch.android
Interface PushRegistrationProvider
public interface PushRegistrationProvider
Defines a push notification registration provider
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Is this provider implemented in the app?void
Is this provider installed on the device?default String
Returns the GCP Project ID.Returns the registration if possible.Returns the Sender ID of the provider, or equivalent.Returns the short name of the provider.
-
Method Details
-
getSenderID
String getSenderID()Returns the Sender ID of the provider, or equivalent. For example: "8122930293" Also known as the GCP Project Number -
getGCPProjectID
Returns the GCP Project ID. For example "batch_sample". Not to be confused with Sender ID, which is the Project Number. Only for FCM. -
getShortname
String getShortname()Returns the short name of the provider. For example: "FCM". -
checkServiceAvailability
Is this provider installed on the device? This is the place to check if the service is installed on the device and if its version match the feature we need.This method will be called when electing the provider for the current start of the app.
If not available, you should throw a
PushRegistrationProviderAvailabilityException
with the human-readable error message. -
checkLibraryAvailability
Is this provider implemented in the app? This is the place to check if the libraries are here at runtime and if the user enabled/disabled your provider.This method will be called right before requesting a push token.
If not available, you should throw a
PushRegistrationProviderAvailabilityException
with the human-readable error message. -
getRegistration
String getRegistration()Returns the registration if possible. Some providers might not have it right away. Return null in these cases.
-