iOS Appendix

 

Appendix 1: Sync Web (HTML) SDK

Since 3.0.8 version you can get the UDID from your WebApp activity to sync with the native app users tracked. What the SDK does is to set the UDID the iOS SDK has generated as a cookie for all requests the WebView launches. 

You have to add these two methods:

/**
 *  This method syncs with eMMa Web SDK
 */
+(void)syncWithWebSDK;

/**
 *  This method, sets the domain where the webApp is hosted without the (http://)
 *  Ex: www.example.com
 *
 *  @param url URL without the http://
 */
+(void)setWebSDKDomain:(NSString*) domain;

Before the WebvView load the WebApp add: 

[eMMa setWebSDKDomain:@"www.miwebappmolona.com"]; // DO NOT ADD HTTP IN THE DOMAIN
[eMMa syncWithWebSDK];

You can load now your WebApp content:

//EX.
[myWebView loadRequest:myWebAppURLRequest];

 

Appendix 2: SDK Guide Upgrade Release

Installation

The header files eMMa.h and eMMaDefines.h and the binary eMMa-Universal-static.a must be added to the project.

Dynamic Tab

All the old methods became removed from the SDK. To use the Dynamic Tab with this new release is necessary to proceed as follows:

1.  Assign a tabBarController with the following method (MANDATORY):

+(void) setPromoTabBarController:(UITabBarController*)tabBarController;

2.  Use the following method to get the Dynamic Tab

+(void) checkPromoOnTabBar;

The position, autoCreation and UITabBarItem can be assigned with the following methods, using them always before checkPromoOnTabBar:

+(void) setPromoTabBarIndex:(NSInteger) index;
+(void) setPromoTabBarItem:(UITabBarItem*) tabBarItem;
+(void) setPromoTabBarAutoCreation:(BOOL) autoCreation;

Strip

The only change on the Strip is on the autoCreation function. Now it is assigned to the following method:

+ (void)setStripAutoCreation:(BOOL) autoCreation;
The method checkForStripWithAutoCreation has been removed on this version.

Banner

The only change on the Banner is on the autoCreation function. Now it is assigned to the following method:

+(void) setBannerAutoCreation:(BOOL) autoCreation;
The following methods have been removed on this version:
+ (void)checkForBannerOnViewController:(UIViewController*)viewController autoCreation:(BOOL)autoCreation label:(NSString*)label;
+ (void)checkForBannerOnViewController:(UIViewController*)viewController autoCreation:(BOOL)autoCreation;

StartView

All the old methods on the StartView have been removed on this version. They must be replaced by the following ones:

/**Sets the current startView options
Options:   eMMaStartViewManualCall -> Sets the startView in manual mode. Useful for using startviews with labels.
Also disables check for startview returning from background@param options all the options for the startview*/
+(void) setStartViewOptions: (eMMaStartViewOptions) options;
/**Sets the delegate for the StartView actions.
This will be called when the user interacts with the StartView**  @param delegate delegate*/
+(void) setStartViewDelegate:(id<eMMaStartViewDelegate>) delegate;

Setting this delegate adds the option to detect when an URL is opened from the StartView with the following method:

-(void) openedURLFromStartView:(NSURL*) url;
/**If you want you can pass a NSDictionary of parameters (key-value pair) that will append to the URL as a GET parameters.
This is useful in case that you need to pass some data from the app to a StartView with a landing page.
@param parameters NSDictionary of parameters*/
+(void) setStartViewParameters:(NSDictionary*) parameters;
/**Use checkForStartViewWithLabel in order to check if show Promotion web views added on eMMa dashboard.
If you want you can pass a custom NSString that labels the StartView in case you use more than one StartViews on your app and you need to distinguish between them.
NOTE: You cannot use autocreation parameter using label because labeled Startviews are attached to a specific part of the app, not at the startup. +(void) checkForStartViewWithLabel: (NSString*) label;
/**Closes the current StartView*/
+(void) closeStartView;

AdBall

All the old methods on the AdBall have been removed on this version. They must be replaced by the following ones: 

/**
Use checkForAdBall in order to check if show AdBalls added on eMMa dashboard.*/
+(void) checkForAdBall;
/**
AdBall configuration options
eMMaAdBallNotInBackground -> Don't check adball on return of background
@param options bitmask of options
*/
+(void) setAdBallOptions: (eMMaAdBallOptions) options;
/**
Use checkForAdBall in order to check if show AdBalls added on eMMa dashboard.
If you want you can pass a custom NSString that labels the AdBall in case you use more than one AdBalls on your app and you need to distinguish between them.
@param label Label to check the adball
*/
+(void) checkForAdBallWithLabel: (NSString*) label;

Push 

All the following Push methods have been removed on this version:

+(void)startPushSystem:(NSDictionary*)options withDelegate:(id)delegate;
+(void)startPushSystem:(NSDictionary*)options showAlert:(BOOL)showAlert;
+(void)startPushSystem:(NSDictionary*)options withDelegate:(id)delegate showAlert:(BOOL)showAlert;
+(void)checkReceivedNotifications:(NSDictionary *)options __deprecated;
They must be replaced by the following ones: 
/**This method allows to configure the behaviour of the push system.
Currently the supported options are:eMMaPushSystemDisableAlert -> Disables showing alert messages for new pushs received.*/
+(void) setPushSystemOptions: (eMMaPushSystemOptions) options;
/**Configures the delegate for push handling@param delegate The delegate object*/
+(void) setPushSystemDelegate: (id<eMMaPushDelegate>)delegate;
/**This method handles the remote notification payload
Example of implementation:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {[eMMa handlePush:userInfo];}
@param userInfo The userInfo payload*/
+(void) handlePush: (NSDictionary*) userInfo;
/**Checks if eMMa had received any push tag in the current sessioneMMaPushTagBlock definition:
typedef void(^eMMaPushTagBlock)(NSString* pushTag, NSString* pushTagID);
@param pushTag the pattern of the pushtag to be checked
@param block the block to be executed on pushtag received*/
+(void) checkPushTag: (NSString*) pushTag withBlock: (eMMaPushTagBlock) block;

Rate Alert

All the old methods on the Rate Alert have been removed on this version. They must be replaced by the following ones: 

+(void) setRateAlertFreq: (int) hours;
+(void) setRateAlertTitle: (NSString*) title;
+(void) setRateAlertMessage: (NSString*) message;
+(void) setRateAlertCancelButton: (NSString*) cancelButtonText;
+(void) setRateAlertRateItButton: (NSString*) rateItButtonText;
+(void) setRateAlertLaterButton: (NSString*) laterButtonText;
+(void) setRateAlertShowAfterUpdate:(BOOL) showAlert;

 To show the Rate Alert use the following method:

+(void)addRateAlertForAppStoreURL:(NSString*)appStoreURL;

Order

The startOrder methods have been reduced to the following 2:

+(void)startOrder:(NSString*)orderId customerId:(NSString*)customerId totalPrice:(float)totalPrice coupon:(NSString*)coupon extras:(NSDictionary*)extras;
+(void)startOrder:(NSString*)orderId customerId:(NSString*)customerId totalPrice:(float)totalPrice coupon:(NSString*)coupon;

GetUserId & GetUserInfo 

The old methods GetUserId and GetUserInfo have been removed on this version. They must be replaced by the following ones: 

+(void)getUserInfo:(eMMaGetUserInfoBlock) resultBlock;
+(void)getUserId:(eMMaGetUserIdBlock) resultBlock;
Have more questions? Submit a request

0 Comments

Article is closed for comments.