Mobile SDK iOS: EPZPromoConfiguration

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
(Initial authoring.)
Current revision (15:22, 7 November 2014) (edit) (undo)
m (Minor formatting updates)
 
Line 39: Line 39:
-
 
+
<hr/>
=== configType ===
=== configType ===
Line 54: Line 54:
-
 
+
<hr/>
=== displayURL ===
=== displayURL ===
Line 69: Line 69:
-
 
+
<hr/>
=== endpointURL ===
=== endpointURL ===
Line 87: Line 87:
-
 
+
<hr/>
=== promoTitle ===
=== promoTitle ===
Line 102: Line 102:
-
 
+
<hr/>
=== assetURLs ===
=== assetURLs ===
Line 119: Line 119:
-
 
+
<hr/>
=== openInNativeBrowser ===
=== openInNativeBrowser ===
Line 136: Line 136:
-
 
+
<hr/>
=== endDate ===
=== endDate ===
Line 151: Line 151:
-
 
+
<hr/>
=== launchDate ===
=== launchDate ===
Line 185: Line 185:
-
 
+
<hr/>
=== resetEndpointURL ===
=== resetEndpointURL ===

Current revision

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. All properties of this class are read-only.

Note: There are methods named initWithKey:data: and promoConfigurationWithKey:data: which are not meant to be used outside of the core SDK logic, and thus, are not documented below.


Tasks

Getting Promotion Configuration Information
  configKey property
  configType property
  displayURL property
  endpointURL property
  promoTitle property
  assetURLs property
  openInNativeBrowser property
  endDate property
  launchDate property

Altering the Endpoint URL
  - appendEndpointURLWithData:
  - resetEndpointURL:


Properties

configKey

The promotion’s configuration key. (read-only)

@property (nonatomic, readonly) NSString *configKey

Discussion
This property provides a reference to the promotion’s configuration key, which is used in the initialization function of EPZPromoWebViewController. This key is also the same key used to store the EPZPromoConfiguration object in the EPZPromoLibrary promoConfigurations object.

Declared In
EPZPromoConfiguration.h



configType

The promotion’s configuration type. (read-only)

@property (nonatomic, readonly) NSString *configType

Discussion
This property provides a reference to 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.

Declared In
EPZPromoConfiguration.h



displayURL

The promotion’s URL, formatted for display. (read-only)

@property (nonatomic, readonly) NSString *displayURL

Discussion
This property provides a reference to 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.

Declared In
EPZPromoConfiguration.h



endpointURL

The promotion’s full URL. (read-only)

@property (nonatomic, readonly) NSString *endpointURL

Discussion
This property provides a reference to the promotion’s full URL. Unlike the displayURL property, this value may include additional URL information such as query parameters, or a URL that is masked by a vanity URL.

Important Note: This is the value that is loaded into the EPZPromoWebViewController.


Declared In
EPZPromoConfiguration.h



promoTitle

The promotion’s title. (read-only)

@property (nonatomic, readonly) NSString *promoTitle

Discussion
This property provides a reference to the promotion’s title.

Declared In
EPZPromoConfiguration.h



assetURLs

A list of the promotion’s asset URLs. (read-only)

@property (nonatomic, readonly) NSDictionary *assetURLs

Discussion
This property provides a reference to the promotion’s asset URLs, as configured in the HelloWorld 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 HelloWorld Configuration Service. As such, if you choose to use asset URLs, it is recommended to do conditional checks for the existence of any dictionary keys you attempt to use, to avoid null values and/or crashes.

Declared In
EPZPromoConfiguration.h



openInNativeBrowser

A flag alerting whether the site is intended to launch in a device’s native browser. (read-only)

@property (nonatomic, readonly) BOOL *openInNativeBrowser

Discussion
This property provides a flag to alert you whether the promotion is intended to launch in a device’s native browser. You can check this value before launching a promotion in your app, and if it is set to YES, you can use the EPZPromoLibrary method launchPromotionForKey:, which will open the promotion’s URL in the device’s native browser, rather than in the built-in SDK web view.

Note: In the interest of giving complete control to your application, the SDK does not automatically open a promotion, either in the native browser or by launching an instance of EPZPromoWebViewController. You are responsible for triggering a promotion to be opened by one of these two means.

Declared In
EPZPromoConfiguration.h



endDate

The promotion’s end date. (read-only)

@property (nonatomic, readonly) NSDate *endDate

Discussion
This property provides a reference to 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.

Declared In
EPZPromoConfiguration.h



launchDate

The promotion’s launch date. (read-only)

@property (nonatomic, readonly) NSDate *launchDate

Discussion
This property provides a reference to 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.

Declared In
EPZPromoConfiguration.h


Instance Methods

appendEndpointURLWithData:

Appends the configuration's endpointURL property with the specified key/value pairs.

- (void) appendEndpointURLWithData:(NSDictionary *)data

Parameters

data
Dictionary of key/value pairs to add to the URL.

Discussion
This method allows the ability to append a configuration's endpoint URL with additional data (which is added via query parameters).

Declared In
EPZPromoConfiguration.h



resetEndpointURL

Resets the configuration's endpointURL property to the default value.

- (void) resetEndpointURL

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

Declared In
EPZPromoConfiguration.h

Personal tools