Link Search Menu Expand Document

Platform Specific Notes

Table of contents
  1. Android
    1. Setting UI Theme
    2. Notifying the app about the lost state
    3. SDK Javadocs
  2. iOS
    1. Device and Simulator Builds
    2. Setting UI Theme
    3. iOS SDK Download Size vs. Install Size

Android

Setting UI Theme

The SDK extends UICustomization to allow to set an Android Theme. For that, the setTheme method is called:

UICustomization uiCustomization = new UICustomization();
uiCustomization.setTheme(R.style.DesiredTheme);

Notifying the app about the lost state

In uSDK 6.5, there has been added an ability for the application to handle the situation when SDK loses its state. On Android, the underlying OS may chose to kill the application task because of low memory when user switches to an other app temporarily. In that case, when the user goes back to the app, the SDK may successfully restore the state of the challenge screen, but it won’t be able to restore the callback instance it has been given in doChallenge method.

In this (very rare case mSIGNIA could only reproduce by tweaking developer’s settings on a few devices) case the SDK attempts to notify the application about the issue but sending a broadcast message expecting the app to be subscribed in Application.onCreate() as shown below:

public class ExampleApplication extends Application {
    @Override
    public void onCreate() {
        BroadcastReceiver receiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                if (UsdkThreeDS2ServiceImpl.SDK_LOST_STATE_ACTION.equals(intent.getAction())) {
                    if (intent.hasExtra(UsdkThreeDS2ServiceImpl.SDK_THREE_DS_SERVER_TRANS_ID_KEY)) {
                        String threeDSServerTransID = intent.getStringExtra(UsdkThreeDS2ServiceImpl.SDK_THREE_DS_SERVER_TRANS_ID_KEY);
                        // Handle lost situation with threeDSServerTransID here
                    } else {
                        // Handle lost situation without threeDSServerTransID here
                    }
                }
            }
        };

        LocalBroadcastManager.getInstance(this).registerReceiver(receiver, new IntentFilter(UsdkThreeDS2ServiceImpl.SDK_LOST_STATE_ACTION));
    }
}

This gives the application a chance to handle the situation - to check the transaction status on the backend and notify the user about further possible actions to take.

The message broadcasted, conveys a threeDSServerTransID data element that the app may use to query its backend for transaction status before prompting the user about the issue. Note, it is required to check the value of threeDSServerTransID for being not null before using like that.

Note, to reproduce this situation, enable “Developer Options” on the device and under the app section change the Background process limit to No background processes. Move app to background and foreground when any SDK’s dialog or challenge activity is on the screen.

If the application does not subscribe to the broadcast, the SDK will display a generic toast message to the user and close its Challenge Activity. That’s a fallback SDK takes in hope not leaving the user alone in this case. It is though recommended to handle the case in the app and give user more information about the transaction.

SDK Javadocs

Click here to access the SDK Javadocs.

iOS

Device and Simulator Builds

The SDK is released with 2 builds, a “device” version and a “simulator” version. The chart below highlights the differences between the 2 builds of SDK.

SDK Device Version Simulator Version
Supported Architectures armv7, arm64 armv7, arm64, x86_64
Bitcode enabled? Yes No

Bitcode can only be enabled for binaries that DO NOT support x86_64. Customers are likely to prefer the device version of SDK at release time, so they can enable bitcode in their apps which allows the app to have a smaller footprint on a user’s device.

However, while developing, many developers prefer to use a simulator, so the x86_64 architecture is necessary. Additionally, during development, the app footprint is typically not a big concern. mSIGNIA releases both bitcode-enabled (“Device”) and bitcode-disabled (“Simulator”) versions of the SDK to allow our customers to choose which they want to work with in any given scenario.

It is important to emphasize that the functionality and interface is exactly the same between the 2 builds. The only difference is supported architectures and bitcode compatibility.

Setting UI Theme

The SDK provides a custom theming protocol and theme manager to provide more control over challenge screen user interface. The UThemable protocol is defined below. Creating a custom object that conforms to the protocol and set it as the currentTheme on UThreeDSThemeManager would do it:

/**
A protocol that defines properties to theme the challenge screens
*/
@protocol UThemable

/**
Sets the background color for views
*/
@property (strong, nonatomic)UIColor *_Nonnull primaryBackgroundColor;

/**
Sets the background color for "secondary" views in order to differentiate from the primary background view.
For example, this would set a text field's background color so it can be different than the surrounding background color
*/
@property (strong, nonatomic)UIColor *_Nonnull secondaryBackgroundColor;

/**
Sets the background color for buttons
*/
@property (strong, nonatomic)UIColor *_Nonnull buttonBackgroundColor;

/**
Sets the textColor property on UIButtons
*/
@property (strong, nonatomic)UIColor *_Nonnull buttonTextColor;

/**
Sets the background color for labels
*/
@property (strong, nonatomic)UIColor *_Nonnull labelBackgroundColor;

/**
Sets the navigation bar's barTintColor property
*/
@property (strong, nonatomic)UIColor *_Nonnull navigationBarBarTintColor;

/**
Sets the navigation bar's tintColor property
*/
@property (strong, nonatomic)UIColor *_Nonnull navigationBarTintColor;

/**
Sets the navigation bar's title's text color
*/
@property (strong, nonatomic)UIColor *_Nonnull navigationBarTitleTextColor;

/**
Sets the text color for labels, text fields, text views, etc.
*/
@property (strong, nonatomic)UIColor *_Nonnull standardTextColor;

/**
Sets the tintColor for various controls like UITextField, UITextView, etc
*/
@property (strong, nonatomic)UIColor *_Nonnull tintColor;

/**
Sets the cornerRadius for various controls like UIButton, UITextField, etc.
*/
@property (assign)CGFloat cornerRadius;

/**
Sets the font for the headers on challenge screens
*/
@property (strong, nonatomic)UIFont *_Nonnull headerFont;

/**
Sets the text color for labels used as headers
*/
@property (strong, nonatomic)UIColor *_Nonnull headerTextColor;

/**
Sets the font for standard controls like UILabel, UITextField, UITextView
*/
@property (strong, nonatomic)UIFont *_Nonnull standardFont;

/**
Sets the font for buttons
*/
@property (strong, nonatomic)UIFont *_Nonnull buttonTitleFont;

/**
Sets the border color for UITextField on challenge screens
*/
@property (strong, nonatomic)UIColor *_Nonnull borderColor;

/**
Sets the width of the border around a text field
*/
@property (assign)CGFloat borderWidth;

/**
Set the keyboardApperance on controls that present a keyboard
*/
@property (assign)UIKeyboardAppearance keyboardApperance;

/**
Sets the title of the navigation bar during the challenge process
*/
@property (strong, nonatomic)NSString *_Nonnull title;

/**
Sets the color for the navigation bar title during the challenge process
*/
@property (strong, nonatomic)UIColor *_Nonnull titleColor;

@end

An example of setting the theme:

UThreeDSThemeManager.shared().setCurrentTheme(myCustomThemableObject)

iOS SDK Download Size vs. Install Size

See here for more details.