iOS

Migrating from FMDeviceManagerFramework to MobRisk

With our company branding change, we made some changes to the API in the SDK. This guide compares the access methods of the new and old versions of SDK and is used as a guide for customers to migrate from the old version of SDK FMDeviceManagerFramework to the new version of SDK TDMobRisk.

Integration changes

New version (TDMobRisk)

using cocoapod integration

  • Add pod 'TrustDecisionPro' to the corresponding target in the Podfile
  • Execute the pod install --repo-update command in the folder where the Podfile is located. (M1 series mac computers need to execute arch -x86_64 pod install --repo-update command)

Old version (FMDeviceManagerFramework)

Need to contact the relevant operation colleagues to download the FMDeviceManagerFramework.framework file integration

Naming Changes

  • The SDK name FMDeviceManagerFramework.framework is renamed to TDMobRisk.framework.
  • The class FMDeviceManager is renamed to TDMobRiskManager.

SDK initialization

new version(TDMobRisk)

  1. Import Header File
#import <TDMobRisk/TDMobRisk.h>
  1. Sample Code
TDMobRiskManager_t *riskManager = [TDMobRiskManager sharedManager];
NSMutableDictionary *options = [NSMutableDictionary dictionary];
// Partner code,partner needs to be provided by the operator
[options setValue:@"[Your partner]" forKey:@"partner"];
// App key, appkey needs to be provided by the operator
[options setValue:@"[Your appKey]" forKey:@"appKey"];
// Country code
[options setValue:@"[Your country code]" forKey:@"country"];
/*************************** Other Parameter ***************************/
//......
#ifdef DEBUG
	[options setValue:@"allowd" forKey:@"allowd"];
#endif

riskManager->initWithOptions(options);

old version(FMDeviceManagerFramework)

  1. Import Header File
#import <FMDeviceManagerFramework/FMDeviceManager.h>
  1. Sample Code
FMDeviceManager_t *manager = [FMDeviceManager sharedManager];
NSMutableDictionary *options = [NSMutableDictionary dictionary];
// Refer to below `Required Parameter`
[options setValue:@"[Your partner]" forKey:@"partner"];
// Set the corresponding domain name according to the region. It does not need to be set in China mainland, but it needs to be set by overseas customers
// For example: the Indonesian domain set below
[options setValue:@"https://idfp.tongdun.net" forKey:@"domain"];
/*************************** Other Parameter ***************************/
//......
#ifdef DEBUG
	[options setValue:@"allowd" forKey:@"allowd"];
#endif

manager->initWithOptions(options);

get blackBox

new version(TDMobRisk)

  1. Import Header File
#import <TDMobRisk/TDMobRisk.h>
  1. Sample Code
TDMobRiskManager_t *riskManager = [TDMobRiskManager sharedManager];
NSString *blackBox = riskManager->getBlackBox();

old version(FMDeviceManagerFramework)

  1. Import Header File
#import <FMDeviceManagerFramework/FMDeviceManager.h>
  1. Sample Code
FMDeviceManager_t *manager = [FMDeviceManager sharedManager];
NSString *blackBox = manager->getDeviceInfo();

Integration result verification

If the integration of the new version SDK is successful, a 26-bit blackBox will be returned in the [options setValue:^(NSString *blackBox) { callback. If a blackBox with a length exceeding 26 is always returned, it means that there is a problem with the integration of the new version SDK. Please contact the same TrustDecision Operations to assist in solving the problem.