Skip to content
szabist edited this page Oct 3, 2019 · 17 revisions

What is Config?

Emarsys SDK now provides a solution for applicationCode and merchantId change in a convenient way without restarting the SDK.

Use cases of applicationCode change

  1. Turn on Mobile Engage feature

    There was no applicationCode set in the SDK before and with Config it can be set from nil to a valid code.

  2. Turn off Mobile Engage feature

    Erase a previously set applicationCode and disable the feature by setting it to nil

  3. Use a different applicationCode

    Change a previously set applicationCode to a new one

Use cases of merchantId change

  1. Turn on Predict feature

    There was no merchantId set in the SDK before and with Config it can be set from nil to a valid merchantId.

  2. Turn off Predict feature

    Erase a previously set merchantId and disable the feature by setting it to nil

  3. Use a different merchantId

    Change a previously set merchantId to a new one

changeApplicationCode

Note

If any error occurs during the change process, the completionBlock will be called with an error and the Mobile Engage feature will be turned off.

Objective-C
[Emarsys.config changeApplicationCode:<applicationCode: NSString>
                          completionBlock:^(NSError *error) {
                                if(error){
                                    NSLog(error);
                                }
                            }];
Swift
Emarsys.config.changeApplicationCode(applicationCodeValue.text) { error in
            if error != nil {
                print("\(error)")
            }        
        }

Errors can be handled in the completionBlock.

changeMerchantId

Objective-C
[Emarsys.config changeMerchantId:<merchantId: NSString>];
Swift
Emarsys.config.changeMerchantId(<merchantId: String>)

applicationCode

Provides what is the actual applicationCode set in the SDK

Objective-C
[Emarsys.config applicationCode];
Swift
Emarsys.config.applicationCode()

merchantId

Provides what is the actual merchantId set in the SDK

Objective-C
[Emarsys.config merchantId];
Swift
Emarsys.config.merchantId()

contactFieldId

Provides what is the actual contactFieldId set in the SDK

Objective-C
[Emarsys.config contactFieldId];
Swift
Emarsys.config.contactFieldId()
Clone this wiki locally