|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sponsorpay.sdk.android.advertiser.SponsorPayAdvertiser
public class SponsorPayAdvertiser
Provides convenience calls to run the Advertiser callback request. Manages the state of the SDK determining whether a successful response to the callback request has been already received since the application was installed in the host device.
It's implemented as a singleton, and its public methods are static.
| Field Summary | |
|---|---|
private AdvertiserCallbackSender |
mAPICaller
AdvertiserCallbackSender used to call the Advertiser API asynchronously. |
private Context |
mContext
Host app's Android application context. |
private HostInfo |
mHostInfo
AdvertiserHostInfo used to collect data related to the host device and application. |
private static SponsorPayAdvertiser |
mInstance
Singleton instance. |
private SponsorPayAdvertiserState |
mPersistedState
Keep track of the persisted state of the Advertiser part of the SDK |
private static java.util.Map<java.lang.String,java.lang.String> |
sCustomParameters
Map of custom key/values to add to the parameters on the requests to the REST API. |
private static boolean |
sShouldUseStagingUrls
|
| Constructor Summary | |
|---|---|
private |
SponsorPayAdvertiser(Context context)
Constructor. |
| Method Summary | |
|---|---|
static void |
clearCustomParameters()
Clears the map of custom key/values to add to the parameters on the requests to the REST API. |
private static java.util.HashMap<java.lang.String,java.lang.String> |
getCustomParameters(java.util.Map<java.lang.String,java.lang.String> passedParameters)
Returns the map of custom key/values to add to the parameters on the requests to the REST API. |
void |
onAPIResponse(boolean wasSuccessful)
This method is invoked when a response for the advertiser callback is received. |
static void |
register(Context context)
Triggers the Advertiser callback. |
static void |
register(Context context,
java.lang.String overrideAppId)
Triggers the Advertiser callback. |
static void |
register(Context context,
java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
Triggers the Advertiser callback. |
private void |
register(java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
This method does the actual registration at the SponsorPay backend, performing the advertiser callback, and including in it a parameter to signal if a successful response has been received yet. |
static void |
registerWithDelay(Context context,
int delayMin)
Triggers the Advertiser callback after the specified delay has passed. |
static void |
registerWithDelay(Context context,
int delayMin,
java.lang.String overrideAppId)
Triggers the Advertiser callback after the specified delay has passed. |
static void |
registerWithDelay(Context context,
int delayMin,
java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
Triggers the Advertiser callback after the specified delay has passed. |
static void |
setCustomParameters(java.util.Map<java.lang.String,java.lang.String> params)
Sets a map of custom key/values to add to the parameters on the requests to the REST API. |
static void |
setCustomParameters(java.lang.String[] keys,
java.lang.String[] values)
Sets a map of custom key/values to add to the parameters on the requests to the REST API. |
static void |
setShouldUseStagingUrls(boolean value)
|
static boolean |
shouldUseStagingUrls()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.util.Map<java.lang.String,java.lang.String> sCustomParameters
private static boolean sShouldUseStagingUrls
private HostInfo mHostInfo
AdvertiserHostInfo used to collect data related to the host device and application.
private AdvertiserCallbackSender mAPICaller
AdvertiserCallbackSender used to call the Advertiser API asynchronously.
private Context mContext
private SponsorPayAdvertiserState mPersistedState
private static SponsorPayAdvertiser mInstance
| Constructor Detail |
|---|
private SponsorPayAdvertiser(Context context)
context - The host application context.| Method Detail |
|---|
public static void setShouldUseStagingUrls(boolean value)
public static boolean shouldUseStagingUrls()
public static void setCustomParameters(java.util.Map<java.lang.String,java.lang.String> params)
params -
public static void setCustomParameters(java.lang.String[] keys,
java.lang.String[] values)
keys - values - public static void clearCustomParameters()
private static java.util.HashMap<java.lang.String,java.lang.String> getCustomParameters(java.util.Map<java.lang.String,java.lang.String> passedParameters)
-
setCustomParameters(Map) or
setCustomParameters(String[], String[]) are not null, a copy of that map is
returned. Otherwise null is returned.public static void register(Context context)
context - Host application context.
public static void registerWithDelay(Context context,
int delayMin)
context - Host application context.delayMin - The delay in minutes for triggering the Advertiser callback.
public static void registerWithDelay(Context context,
int delayMin,
java.lang.String overrideAppId)
context - Host application context.delayMin - The delay in minutes for triggering the Advertiser callback.overrideAppId - The App ID to use.
public static void registerWithDelay(Context context,
int delayMin,
java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
context - Host application context.delayMin - The delay in minutes for triggering the Advertiser callback.overrideAppId - The App ID to use.customParams - Map of custom key/values to add to the parameters on the requests to the REST API.
public static void register(Context context,
java.lang.String overrideAppId)
context - Host application context.overrideAppId - The App ID to use.
public static void register(Context context,
java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
context - Host application context.overrideAppId - The App ID to use.customParams - A map of extra key/value pairs to add to the request URL.
private void register(java.lang.String overrideAppId,
java.util.Map<java.lang.String,java.lang.String> customParams)
overrideAppId - If left empty (""), will use the App ID value from the application manifest xml
file. Otherwise, will use the specified App ID.customParams - A map of extra key/value pairs to add to the request URL.public void onAPIResponse(boolean wasSuccessful)
onAPIResponse in interface AdvertiserCallbackSender.APIResultListenerwasSuccessful - Status flag to indicate if Advertiser API has been contacted successfully.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||