com.sponsorpay.sdk.android.publisher
Class OfferWebClient

java.lang.Object
  extended by WebViewClient
      extended by com.sponsorpay.sdk.android.publisher.OfferWebClient
Direct Known Subclasses:
ActivityOfferWebClient

public abstract class OfferWebClient
extends WebViewClient

WebViewClient implementing common functionality for WebView instances displaying SponsorPay offers.


Field Summary
private static java.lang.String EXIT_URL_RESULT_CODE_PARAM_KEY
           
private static java.lang.String EXIT_URL_TARGET_URL_PARAM_KEY
           
static java.lang.String LOG_TAG
           
static int RESULT_CODE_NO_STATUS_CODE
          The result code that is returned when the parsed exit scheme does not contain a status code.
private static java.lang.String SPONSORPAY_EXIT_SCHEMA
           
 
Constructor Summary
OfferWebClient()
           
 
Method Summary
protected  boolean launchActivityWithUrl(Activity launcherActivity, java.lang.String url)
           
protected abstract  void onSponsorPayExitScheme(int resultCode, java.lang.String targetUrl)
           
protected static int parseSponsorPayExitUrlForResultCode(java.lang.String url)
          Extracts the status code from the scheme
protected static java.lang.String parseSponsorPayExitUrlForTargetUrl(java.lang.String url)
          Extracts the provided URL from the exit scheme
 boolean shouldOverrideUrlLoading(WebView view, java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_TAG

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

SPONSORPAY_EXIT_SCHEMA

private static final java.lang.String SPONSORPAY_EXIT_SCHEMA
See Also:
Constant Field Values

EXIT_URL_TARGET_URL_PARAM_KEY

private static final java.lang.String EXIT_URL_TARGET_URL_PARAM_KEY
See Also:
Constant Field Values

EXIT_URL_RESULT_CODE_PARAM_KEY

private static final java.lang.String EXIT_URL_RESULT_CODE_PARAM_KEY
See Also:
Constant Field Values

RESULT_CODE_NO_STATUS_CODE

public static final int RESULT_CODE_NO_STATUS_CODE
The result code that is returned when the parsed exit scheme does not contain a status code.

See Also:
Constant Field Values
Constructor Detail

OfferWebClient

public OfferWebClient()
Method Detail

parseSponsorPayExitUrlForTargetUrl

protected static java.lang.String parseSponsorPayExitUrlForTargetUrl(java.lang.String url)
Extracts the provided URL from the exit scheme

Parameters:
url - the exit scheme url to parse
Returns:
the extracted, provided & decoded URL

parseSponsorPayExitUrlForResultCode

protected static int parseSponsorPayExitUrlForResultCode(java.lang.String url)
Extracts the status code from the scheme

Parameters:
url - the url to parsed for the status code
Returns:
the status code

shouldOverrideUrlLoading

public boolean shouldOverrideUrlLoading(WebView view,
                                        java.lang.String url)

launchActivityWithUrl

protected boolean launchActivityWithUrl(Activity launcherActivity,
                                        java.lang.String url)

onSponsorPayExitScheme

protected abstract void onSponsorPayExitScheme(int resultCode,
                                               java.lang.String targetUrl)