pod 'TrustDecisionPro', '5.3.2' to the target in the Podfilepod 'TrustDecisionAPISign', '1.1.3' to the target in the Podfilepod install --repo-update command in the folder where the Podfile is located. (M series mac computers need to execute arch -x86_64 pod install --repo-updatecommand)Include the header file at the location where it is called.
#import <TDMobRisk/TDMobRisk.h>
TDAPISignResult (*sign)(NSString *path);typedef struct _TDAPISignResult{
// Signature result
const char* sign;
// Status code
int code;
// Error message
const char* msg;
}TDAPISignResult;The API to be protected is in the following form: https://sg.apitd.net/de/v1
The determination is made based on the status code returned by the signature.
TDAPISignResult.code==0NSString *path = @"de/v1";
TDMobRiskManager_t *manager = [TDMobRiskManager sharedManager];
TDAPISignResult result = manager->sign(path);
// Sign Success
if(result.code == 0){
// Get signature
NSString* signString = [NSString stringWithUTF8String:result.sign];
}else{
// Get status code
int code = result.code;
// Get error message
NSString* errMsgString = [NSString stringWithUTF8String:result.msg];
// Continuing with the business logic, the application here can handle exceptions based on the business logic.
}