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.
Install
SDK
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)
Name
- The SDK name
FMDeviceManagerFramework.framework
is renamed toTDMobRisk.framework
. - The class
FMDeviceManager
is renamed toTDMobRiskManager
.
Initialization
- Import Header File
#import <TDMobRisk/TDMobRisk.h>
- 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);
Get blackBox
- Import Header File
#import <TDMobRisk/TDMobRisk.h>
- Sample Code
TDMobRiskManager_t *riskManager = [TDMobRiskManager sharedManager];
NSString *blackBox = riskManager->getBlackBox();
Integration status check
If the integration of the new version SDK is successful, a 26-bit blackBox will be returned in the riskManager->getBlackBoxAsync(^(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.