public class LeanplumPushService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LEANPLUM_ACTION_PARAM
Action param key contained when Notification Bundle is parsed with
parseNotificationBundle(Bundle) . |
static java.lang.String |
LEANPLUM_MESSAGE_ID
Message id param key contained when Notification Bundle is parsed with
parseNotificationBundle(Bundle) . |
static java.lang.String |
LEANPLUM_MESSAGE_PARAM
Message title param key contained when Notification Bundle is parsed with
parseNotificationBundle(Bundle) . |
static java.lang.String |
LEANPLUM_NOTIFICATION
Intent action used when broadcast is received in custom BroadcastReceiver.
|
static java.lang.String |
LEANPLUM_SENDER_ID
Leanplum's built-in Google Cloud Messaging sender ID.
|
Constructor and Description |
---|
LeanplumPushService() |
Modifier and Type | Method and Description |
---|---|
static void |
enableFirebase()
Deprecated.
FCM is no longer packaged in the SDK. Instead it is split up into modules.
Modify your build.gradle by replacing implementation 'com.leanplum:Leanplum:+'
with each module separately.
For example:
implementation 'com.leanplum:leanplum-fcm:+'
implementation 'com.leanplum:leanplum-location:+'
|
static java.util.Map<java.lang.String,java.lang.Object> |
parseNotificationBundle(android.os.Bundle notificationBundle)
Parse notification bundle.
|
static void |
postHandlePushNotification(android.content.Context context,
android.content.Intent intent)
Must be called after deciding which activity will be opened, to allow Leanplum SDK to track
stats, open events etc.
|
static android.os.Bundle |
preHandlePushNotification(android.content.Context context,
android.content.Intent intent)
Must be called before deciding which activity will be opened, to allow Leanplum SDK to track
stats, open events etc.
|
static void |
setCustomizer(LeanplumPushNotificationCustomizer customizer)
Sets an object used to customize the appearance of notifications.
|
static void |
setCustomizer(LeanplumPushNotificationCustomizer customizer,
boolean useNotificationBuilderCustomizer)
Sets an object used to customize the appearance of notifications.
|
static void |
setDefaultCallbackClass(java.lang.Class<? extends android.app.Activity> callbackClass)
Changes the default activity to launch if the user opens a push notification.
|
static void |
setGcmRegistrationId(java.lang.String token)
Register manually for Google Cloud Messaging services.
|
static void |
setGcmSenderId(java.lang.String senderId)
Sets the Google Cloud Messaging sender ID.
|
static void |
setGcmSenderIds(java.lang.String... senderIds)
Sets the Google Cloud Messaging sender ID.
|
static void |
unregister()
Unregisters the device from all GCM push notifications.
|
public static final java.lang.String LEANPLUM_SENDER_ID
public static final java.lang.String LEANPLUM_NOTIFICATION
public static final java.lang.String LEANPLUM_ACTION_PARAM
parseNotificationBundle(Bundle)
.public static final java.lang.String LEANPLUM_MESSAGE_PARAM
parseNotificationBundle(Bundle)
.public static final java.lang.String LEANPLUM_MESSAGE_ID
parseNotificationBundle(Bundle)
.public static void setGcmSenderId(java.lang.String senderId)
senderId
- The GCM sender ID to permit notifications from. Use LEANPLUM_SENDER_ID
to use the built-in sender ID for GCM. If you have
multiple sender IDs, use setGcmSenderIds(java.lang.String...)
.public static void setGcmSenderIds(java.lang.String... senderIds)
senderIds
- The GCM sender IDs to permit notifications from. Use LEANPLUM_SENDER_ID
to use the built-in sender ID.@Deprecated public static void enableFirebase()
public static void setDefaultCallbackClass(java.lang.Class<? extends android.app.Activity> callbackClass)
callbackClass
- The activity class.public static void setCustomizer(LeanplumPushNotificationCustomizer customizer)
customizer
- LeanplumPushNotificationCustomizer push notification customizer.public static void setCustomizer(LeanplumPushNotificationCustomizer customizer, boolean useNotificationBuilderCustomizer)
customizer
- LeanplumPushNotificationCustomizer push notification customizer.useNotificationBuilderCustomizer
- True if if you want to support 2 lines of text on
BigPicture style push notification.public static java.util.Map<java.lang.String,java.lang.Object> parseNotificationBundle(android.os.Bundle notificationBundle)
LEANPLUM_ACTION_PARAM
, LEANPLUM_MESSAGE_PARAM
and LEANPLUM_MESSAGE_ID
notificationBundle
- Bundle to be parsed.public static android.os.Bundle preHandlePushNotification(android.content.Context context, android.content.Intent intent)
context
- Surrounding context.intent
- Received Intent.public static void postHandlePushNotification(android.content.Context context, android.content.Intent intent)
context
- Surrounding context.intent
- Received Intent.public static void unregister()
public static void setGcmRegistrationId(java.lang.String token)
token
- The registration ID token or the instance ID security token.