|
||||||||||
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 | |
---|---|
static int |
BUGFIX_RELEASE_NUMBER
|
static int |
MAJOR_RELEASE_NUMBER
Version information. |
private AsyncAPICaller |
mAPICaller
AsyncAPICaller used to call the Advertiser API asynchronously. |
private Context |
mContext
Host app's Android application context. |
private AdvertiserHostInfo |
mHostInfo
AdvertiserHostInfo used to collect data related to the host device and application. |
static int |
MINOR_RELEASE_NUMBER
|
private static SponsorPayAdvertiser |
mInstance
Singleton instance. |
private SharedPreferences |
mPrefs
The shared preferences encoded in the PREFERENCES_FILE_NAME file. |
private static java.lang.String |
PREFERENCES_FILE_NAME
Shared preferences file name. |
private static boolean |
sShouldUseStagingUrls
|
private static java.lang.String |
STATE_GOT_SUCCESSFUL_RESPONSE_KEY
The key to store in the preferences file the flag which determines if we have already successfully contacted the Advertiser API. |
static java.lang.String |
VERSION_STRING
|
Constructor Summary | |
---|---|
private |
SponsorPayAdvertiser(Context context)
Constructor. |
Method Summary | |
---|---|
void |
onAPIResponse(boolean wasSuccessful)
This method is invoked when a response for the advertiser callback is received. |
private void |
register()
Calls its overload register() with an empty overrideOfferId parameter. |
static void |
register(Context context)
Trigger the Advertiser callback. |
static void |
register(Context context,
java.lang.String overrideOfferId)
Trigger the Advertiser callback. |
static void |
registerWithDelay(Context context,
int delayMin)
Trigger the Advertiser callback after the specified delay has passed. |
static void |
registerWithDelay(Context context,
int delayMin,
java.lang.String overrideOfferId)
Trigger the Advertiser callback after the specified delay has passed. |
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 |
---|
public static final int MAJOR_RELEASE_NUMBER
public static final int MINOR_RELEASE_NUMBER
public static final int BUGFIX_RELEASE_NUMBER
public static final java.lang.String VERSION_STRING
private static final java.lang.String PREFERENCES_FILE_NAME
register()
, to ensure that once we have once successfully contacted the Advertiser API we
shall never send the advertiser callback request again (provided the user doesn't uninstall and reinstall the
application, or delete all its preferences).
private static final java.lang.String STATE_GOT_SUCCESSFUL_RESPONSE_KEY
private SharedPreferences mPrefs
PREFERENCES_FILE_NAME
file.
private static boolean sShouldUseStagingUrls
private AdvertiserHostInfo mHostInfo
AdvertiserHostInfo
used to collect data related to the host device and application.
private AsyncAPICaller mAPICaller
AsyncAPICaller
used to call the Advertiser API asynchronously.
private Context mContext
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 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 overrideOfferId)
context
- Host application context.delayMin
- The delay in minutes for triggering the Advertiser callback.overrideOfferId
- The offer id to use.public static void register(Context context, java.lang.String overrideOfferId)
context
- Host application context.overrideOfferId
- The offer id to use.private void register()
register()
with an empty overrideOfferId parameter.
public void onAPIResponse(boolean wasSuccessful)
onAPIResponse
in interface AsyncAPICaller.APIResultListener
wasSuccessful
- status flag if the Ad API has been contacted successfully
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |