Requirement
Environment
| Items | Description |
|---|---|
| Supported System Versions | iOS 9.0 and above |
| Supported Architectures | armv7, arm64, x86_64 |
Integration
Install(CocoaPods)
- Add
pod 'TrustDecisionPro', '5.2.4.1'to the target in the Podfile - Add
pod 'TrustDecisionAPISign', '1.1.1'to the target in the Podfile - Execute the
pod install --repo-updatecommand in the folder where the Podfile is located. (M series mac computers need to executearch -x86_64 pod install --repo-updatecommand)
Import Header File
Include the header file at the location where it is called.
#import <TDMobRisk/TDMobRisk.h>import TDMobRiskInterface Signature
API Definition
TDAPISignResult (*sign)(NSString *path);Struct Definition
typedef struct _TDAPISignResult{
// Signature result
const char* sign;
// Status code
int code;
// Error message
const char* msg;
}TDAPISignResult;Best Practices
The API to be protected is in the following form: https://sg.apitd.net/de/v1
NSString *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.
}let body = "sdsdsdsds...ihhfywehnas"
let path = "de/v1"
let manager = TDMobRiskManager.sharedManager()
let result = manager?.pointee.signWithBody(path,body)
// Sign Success
if result?.code == 0 {
// Get signature
let signString = result?.sign
}else {
// Get status code
let code = result?.code
// Get error message
let errMsgString = result?.msg;
// Continuing with the business logic, the application here can handle exceptions based on the business logic
}Status Check
The determination is made based on the status code returned by the signature.
TDAPISignResult.code==0
Status Code
| Code | Message | Remarks |
|---|---|---|
| 0 | Success | / |
| 2000 | Path is empty | Please set the path parameter. |
| 22xx | Internal error | Please contact technical support. |
| 3001 | Internal error | Please contact technical support. |
| 3002 | Internal error | Please contact technical support. |
| 3003 | Internal error | Please contact technical support. |
| 3004 | Internal error | Please contact technical support. |
