Mobile SDK Android: EPZPromoConfiguration

From ePrize Developers Wiki

Revision as of 23:06, 6 November 2014 by Anthony-hessler (Talk | contribs)
Jump to: navigation, search

Contents

Overview

The EPZPromoConfiguration class stores all necessary information specific to a promotion. You can use an instance of this class to gain access to all of the applicable pieces of information you’ll need for reference, display, and functionality.

Public Methods

resetEndpointURL

public void resetEndpointURL()

Method that resets the configuration's endpoint URL to the default value, removing any additional data that may have been added via the appendEndpointURLWithData method.



appendEndpointURLWithData

public String appendEndpointURLWithData(Map<String, String> data)

Method that appends a configuration's endpoint URL with additional data (which is added via query parameters).

Parameters
data A map of String key/value pairs to be added to the endpoint URL.

Please note: This method will alter the stored value for the endpoint URL. As such, calling this method multiple times, especially with the same data set, is not advisable. If you must call this method, it is strongly recommended you include conditional logic in your app that detects the presence of a specific query parameter on the endpoint URL, and only call this method if no such value exists.



getConfigKey

public String getConfigKey()

Returns
String The configuration's key. This key is used to pass in to various methods, such as the EPZPromoLibrary launchPromotionForKey() method.



getConfigType

public String getConfigType()

Returns
String The promotion’s configuration type. As of version 1.0, the only value for this property is “mobileSdkV1”. This property serves little value outside of the core SDK logic.



getDisplayURL

public String getDisplayURL()

Returns
String The promotion’s URL, targeted for display. For instance, if a promotion uses a vanity URL, the vanity URL can be the value for this property. Similarly, if a promotion URL has query parameters attached to the URL that are not intended for display, this value may crop off the parameters, resulting in a URL that is more pleasing to the eye.



getEndpointURL

public String getEndpointURL()

Returns
String The promotion’s full URL. Unlike the display URL, this value may include additional URL information such as query parameters, or a URL that is masked by a vanity URL.



getPromoTitle

public String getPromoTitle()

Returns
String The promotion's title.



getAssetURLs

public Map<String, String> getAssetURLs()

Returns
Map<String, String> of the promotion’s asset URLs, as configured in the ePrize Configuration Service.

Important Note: There are no set or default key values for this property, as all asset URLs are the responsibility of the party who configures the promotion in the ePrize Configuration Service. As such, if you choose to use asset URLs, it is recommended to do conditional checks for the existence of any map keys you attempt to use, to avoid null values and/or crashes.



getOpenInNativeBrowser

public Boolean getOpenInNativeBrowser()

Returns
Boolean flag alerting whether the site is intended to launch in a device’s native browser. If true, the promotion will launch in the device's native browser rather than in the built-in EPZPromoWebViewController. This logic is handled automatically by the SDK in the launchPromotionForKey() method.



getEndDate

public Date getEndDate()

Returns
Date The promotion’s end date. If you would like to know and/or display the end date for a promotion, you can use this property to get the value, and then use it as necessary.



getLaunchDate

public Date getLaunchDate()

Returns
Date The promotion’s launch date. If you would like to know and/or display the launch date for a promotion, you can use this property to get the value, and then use it as necessary.

Personal tools