public class BlueshiftUtils
extends java.lang.Object
| Constructor and Description |
|---|
BlueshiftUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
buildTrackApiAttributesFromPayload(java.util.Map<java.lang.String,java.lang.Object> inputMap,
android.content.Context context)
This method is responsible for building the attributes for calling the track API.
|
static boolean |
canAutomaticAppOpenBeSentNow(android.content.Context context)
Checks if we can send an app_open now.
|
static java.lang.String |
getApiKey(android.content.Context context)
This method checks if a non-empty API key is supplied to the
SDK while initialization and returns the same if available.
|
static Configuration |
getConfiguration(android.content.Context context)
Checks if a not-null
Configuration object is supplied during
the SDK initialization and returns the same if available. |
static boolean |
isAutomaticAppOpenFiringEnabled(android.content.Context context)
Checks the config object provided during SDK initialisation to see automatic app_open event
firing is enabled.
|
static boolean |
isBlueshiftPushMessage(android.content.Intent intent)
Checks the payload received and looks for bsft_message_uuid in it to confirm if
the push message belongs to Blueshift.
|
static boolean |
isBlueshiftPushMessage(RemoteMessage remoteMessage)
Checks the payload received and looks for bsft_message_uuid in it to confirm if
the push message belongs to Blueshift.
|
static boolean |
isInAppEnabled(android.content.Context context)
Checks the config object provided during SDK initialisation to see if in-app is enabled.
|
static boolean |
isOptedInForInAppMessages(android.content.Context context)
Checks both config and app preferences to see if the user has opted in for in-app messages.
|
static boolean |
isOptedInForPushNotification(android.content.Context context)
Checks both system settings and app preferences to see if the user has opted in for push
notifications.
|
static boolean |
isPushEnabled(android.content.Context context)
Checks the config object provided during SDK initialisation to see if push is enabled.
|
public static java.lang.String getApiKey(android.content.Context context)
context - Context object to get the Blueshift instance.public static Configuration getConfiguration(android.content.Context context)
Configuration object is supplied during
the SDK initialization and returns the same if available.context - Context object to get the Blueshift instance.Configuration object, if found. Else null.public static boolean isAutomaticAppOpenFiringEnabled(android.content.Context context)
context - valid Context objectpublic static boolean canAutomaticAppOpenBeSentNow(android.content.Context context)
This method is used internally by the SDK to throttle automatic app_open events.
context - valid Context objectpublic static boolean isInAppEnabled(android.content.Context context)
context - valid Context objectpublic static boolean isPushEnabled(android.content.Context context)
context - valid Context objectpublic static boolean isOptedInForInAppMessages(android.content.Context context)
context - valid Context objectpublic static boolean isOptedInForPushNotification(android.content.Context context)
context - valid Context objectpublic static boolean isBlueshiftPushMessage(android.content.Intent intent)
intent - from push message receiverpublic static boolean isBlueshiftPushMessage(RemoteMessage remoteMessage)
remoteMessage - from push message receiverpublic static java.util.Map<java.lang.String,java.lang.String> buildTrackApiAttributesFromPayload(java.util.Map<java.lang.String,java.lang.Object> inputMap,
android.content.Context context)
Note: This method must be called from a non UI thread if the deviceIdSource is set to ADVERTISING_ID.
inputMap - in-app or push payload with additional tracking info.context - valid Context object.Map of attributes with appropriate keys required to call the track API.