com.sponsorpay.sdk.android.advertiser
Class SponsorPayCallbackDelayer

java.lang.Object
  extended by BroadcastReceiver
      extended by com.sponsorpay.sdk.android.advertiser.SponsorPayCallbackDelayer

public class SponsorPayCallbackDelayer
extends BroadcastReceiver

Enables triggering the advertiser's callback with a delay. Uses the Android alarm mechanism provided by AlarmManager.


Field Summary
static java.lang.String ACTION_TRIGGER_SPONSORPAY_CALLBACK
           
static java.lang.String EXTRA_APPID_KEY
           
static int MILLISECONDS_IN_MINUTE
           
 
Constructor Summary
SponsorPayCallbackDelayer()
           
 
Method Summary
static void callWithDelay(Context context, java.lang.String appId, long delayMinutes)
          Triggers the Advertiser callback after the specified delay has passed.
 void onReceive(Context context, Intent intent)
          onReceived method overridden from BroadcastReceiver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_TRIGGER_SPONSORPAY_CALLBACK

public static final java.lang.String ACTION_TRIGGER_SPONSORPAY_CALLBACK
See Also:
Constant Field Values

EXTRA_APPID_KEY

public static final java.lang.String EXTRA_APPID_KEY
See Also:
Constant Field Values

MILLISECONDS_IN_MINUTE

public static final int MILLISECONDS_IN_MINUTE
See Also:
Constant Field Values
Constructor Detail

SponsorPayCallbackDelayer

public SponsorPayCallbackDelayer()
Method Detail

callWithDelay

public static void callWithDelay(Context context,
                                 java.lang.String appId,
                                 long delayMinutes)
Triggers the Advertiser callback after the specified delay has passed. Will use the provided Apps ID instead of trying to retrieve the one defined in the host application's manifest. Registers an alarm with the OS AlarmManager. onReceive(Context, Intent) will be invoked when the specified period of time has elapsed .

Parameters:
context - Host application context.
appId - The App ID to use. Pass an empty string to let the SDK try to retrieve it from the application manifest.
delayMinutes - The delay in minutes for triggering the Advertiser callback.

onReceive

public void onReceive(Context context,
                      Intent intent)
onReceived method overridden from BroadcastReceiver. Performs the actual triggering of the callback.