public abstract class CampaignBroadcastReceiver extends BroadcastReceiver
An abstract class to assist with retrieving data from a Meridian Campaign triggered Broadcast.
BroadcastReceiver.PendingResult
Constructor and Description |
---|
CampaignBroadcastReceiver() |
Modifier and Type | Method and Description |
---|---|
static EditorKey |
getAppKey(Intent i)
Retrieve the Meridian App Key that this broadcast was triggered with.
|
static String |
getCampaignId(Intent i)
Retrieve the Meridian Campaign Identifier that this broadcast was triggered with.
|
static String |
getCustom(Intent i)
An arbitrary string provided by 3rd party campaign endpoints for use in the client.
|
protected Map<String,String> |
getPushRegistrationUserInfo(Context context)
When a device is registered, the campaign service will call this method just before sending the registration request.
|
static String |
getUserData(Intent i)
An arbitrary string provided by the campaign for use in the client.
|
protected Map<String,String> |
getUserInfoForCampaign(Context context,
String campaignIdentifier)
When a campaign is triggered, the campaign service will call this method just before sending the request.
|
void |
onReceive(Context context,
Intent intent) |
protected abstract void |
onReceive(Context context,
Intent intent,
String title,
String message)
Forwarded from
BroadcastReceiver.onReceive(android.content.Context, android.content.Intent) with title and message unpacked for convenience. |
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
public final void onReceive(Context context, Intent intent)
onReceive
in class BroadcastReceiver
protected abstract void onReceive(Context context, Intent intent, String title, String message)
Forwarded from BroadcastReceiver.onReceive(android.content.Context, android.content.Intent)
with title and message unpacked for convenience.
intent
- The intent delivered with this broadcast.title
- The user facing title of the Campaign.message
- The user facing message of the Campaign.protected Map<String,String> getUserInfoForCampaign(Context context, String campaignIdentifier)
When a campaign is triggered, the campaign service will call this method just before sending the request. You can return a Map of parameters to include in the request, which will be forwarded to any third-party URL associated with the campaign.
context
- The context of the application requesting the user info.campaignIdentifier
- A string identifying the campaign that’s being triggered.protected Map<String,String> getPushRegistrationUserInfo(Context context)
When a device is registered, the campaign service will call this method just before sending the registration request. You can return a Map of parameters to include in the request, which will be forwarded to any third-party URL associated with the campaign.
context
- The context of the application requesting the user info.public static EditorKey getAppKey(Intent i)
Retrieve the Meridian App Key that this broadcast was triggered with.
public static String getUserData(Intent i)
An arbitrary string provided by the campaign for use in the client.
public static String getCustom(Intent i)
An arbitrary string provided by 3rd party campaign endpoints for use in the client.