react-native-trustdevice 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +118 -0
  2. package/index.js +3 -0
  3. package/ios/FMDeviceManagerFramework.xcframework/Info.plist +41 -0
  4. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_armv7/FMDeviceManagerFramework.framework/FMDeviceManagerFramework +0 -0
  5. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_armv7/FMDeviceManagerFramework.framework/Headers/FMDeviceManager.h +49 -0
  6. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_armv7/FMDeviceManagerFramework.framework/Modules/module.modulemap +6 -0
  7. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_x86_64-simulator/FMDeviceManagerFramework.framework/FMDeviceManagerFramework +0 -0
  8. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_x86_64-simulator/FMDeviceManagerFramework.framework/Headers/FMDeviceManager.h +49 -0
  9. package/ios/FMDeviceManagerFramework.xcframework/ios-arm64_x86_64-simulator/FMDeviceManagerFramework.framework/Modules/module.modulemap +6 -0
  10. package/ios/TDCaptchaManager.h +63 -0
  11. package/ios/TDCaptchaResource.bundle/icon_tongdun_loading@2x.png +0 -0
  12. package/ios/TDCaptchaResource.bundle/icon_tongdun_loading@3x.png +0 -0
  13. package/ios/TDCaptchaResource.bundle/icon_tongdun_logo@2x.png +0 -0
  14. package/ios/TDCaptchaResource.bundle/icon_tongdun_logo@3x.png +0 -0
  15. package/ios/TDCaptchaResource.bundle/webview2.html +1 -0
  16. package/ios/TDMobRisk.xcframework/Info.plist +41 -0
  17. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/Headers/TDMobRisk.h +17 -0
  18. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/Headers/TDMobRiskManager.h +196 -0
  19. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/Info.plist +0 -0
  20. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/Modules/module.modulemap +6 -0
  21. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/TDMobRisk +0 -0
  22. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/_CodeSignature/CodeDirectory +0 -0
  23. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/_CodeSignature/CodeRequirements +0 -0
  24. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/_CodeSignature/CodeRequirements-1 +0 -0
  25. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/_CodeSignature/CodeResources +147 -0
  26. package/ios/TDMobRisk.xcframework/ios-arm64_armv7/TDMobRisk.framework/_CodeSignature/CodeSignature +0 -0
  27. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/Headers/TDMobRisk.h +17 -0
  28. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/Headers/TDMobRiskManager.h +196 -0
  29. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/Info.plist +0 -0
  30. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/Modules/module.modulemap +6 -0
  31. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/TDMobRisk +0 -0
  32. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/_CodeSignature/CodeDirectory +0 -0
  33. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/_CodeSignature/CodeRequirements +0 -0
  34. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/_CodeSignature/CodeRequirements-1 +0 -0
  35. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/_CodeSignature/CodeResources +147 -0
  36. package/ios/TDMobRisk.xcframework/ios-arm64_x86_64-simulator/TDMobRisk.framework/_CodeSignature/CodeSignature +0 -0
  37. package/ios/TrustDevice.h +17 -0
  38. package/ios/TrustDevice.m +114 -0
  39. package/ios/TrustDevice.xcodeproj/project.pbxproj +282 -0
  40. package/ios/TrustDevice.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  41. package/ios/TrustDevice.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  42. package/ios/TrustDevice.xcodeproj/project.xcworkspace/xcuserdata/lee.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  43. package/ios/TrustDevice.xcodeproj/xcuserdata/lee.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
  44. package/ios/libTDCaptcha.a +0 -0
  45. package/package.json +26 -0
  46. package/src/TrustDevice.android.js +37 -0
  47. package/src/TrustDevice.ios.js +9 -0
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ [![npm version](https://badge.fury.io/js/react-native-blur.svg)](https://badge.fury.io/js/react-native-blur)
2
+
3
+ ### React Native Counting
4
+ Component implementation for Dynamic digital effect.<br>
5
+
6
+
7
+ <img src='http://image18-c.poco.cn/mypoco/myphoto/20170303/17/18509322420170303172443095.gif?311x565_110' />
8
+
9
+ ### 用法
10
+ 1. npm install react-native-counting --save
11
+ 2. react-native link react-native-counting
12
+
13
+ ### 注意
14
+ Android暂时无法使用border相关的属性
15
+
16
+ ### 属性&&方法
17
+ * text:String 默认显示的文字
18
+ * fontProperty:object 传入一个对象</br>
19
+ 1. fontSize:字体大小(Int)
20
+ 2. textAlignment:center || left ||right 对齐方式(string)
21
+ 3. boldSystem:是否加粗(bool)
22
+ 4. method:动画方式(String) EaseInOut || EaseIn || EaseOut || Linear
23
+ * textColor 文字底色(Colo)
24
+ * onFinish 完成回调执行的方法(func)
25
+
26
+
27
+ #### Counting:
28
+
29
+ ```javascript
30
+ import React, { Component } from 'react';
31
+ import Counting from 'react-native-counting';
32
+ import {
33
+ AppRegistry,
34
+ StyleSheet,
35
+ Text,
36
+ View,
37
+ TouchableOpacity
38
+ } from 'react-native';
39
+
40
+
41
+
42
+ export default class nodeforum extends Component {
43
+
44
+ constructor(props){
45
+ super(props)
46
+ this.state = {
47
+ finshded:false
48
+ }
49
+ }
50
+
51
+ _onPressButton(){
52
+ this.counting.countingStart(0,5200.10,3000);
53
+ this.setState({
54
+ finshded:false
55
+ })
56
+ }
57
+
58
+ _finish(){
59
+ this.setState({
60
+ finshded:true
61
+ })
62
+ }
63
+
64
+ render() {
65
+
66
+ const fontProperty = {
67
+ fontSize:35,
68
+ textAlignment:'center',
69
+ boldSystem:false,
70
+ method:'Linear'
71
+ }
72
+ const { finshded } = this.state;
73
+ return (
74
+ <View style={styles.container}>
75
+ <Counting style={styles.counting} text="0.00" ref={(ref) => this.counting = ref} fontProperty={fontProperty} textColor="white" onFinish={this._finish.bind(this)}/>
76
+ <TouchableOpacity onPress={this._onPressButton.bind(this)} style={styles.button}>
77
+ <Text>click Me</Text>
78
+ </TouchableOpacity>
79
+ <Text style={styles.isfinish}>{finshded?"finished":"dnf"}</Text>
80
+ </View>
81
+ );
82
+ }
83
+ }
84
+
85
+ const styles = StyleSheet.create({
86
+ container: {
87
+ flex: 1,
88
+ alignItems: 'center',
89
+ },
90
+ button:{
91
+ marginTop:20,
92
+ },
93
+ counting:{
94
+ marginTop:60,
95
+ backgroundColor:'black',
96
+ width:180,
97
+ height:150,
98
+ borderRadius:20,
99
+ },
100
+ isfinish:{
101
+ marginTop:20,
102
+ color:'red'
103
+ }
104
+
105
+ });
106
+
107
+ AppRegistry.registerComponent('nodeforum', () => nodeforum);
108
+ ```
109
+
110
+ In this example, `Image` component will be blurred, a `BlurView` content will stay untouched.
111
+
112
+
113
+ ### Questions?
114
+ Feel free to contact me By qq(452359549)
115
+
116
+ ### thanks
117
+
118
+
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ const Counting = require('./src/TrustDevice');
2
+
3
+ module.exports = TrustDevice;
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>LibraryIdentifier</key>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
+ <key>LibraryPath</key>
11
+ <string>FMDeviceManagerFramework.framework</string>
12
+ <key>SupportedArchitectures</key>
13
+ <array>
14
+ <string>arm64</string>
15
+ <string>x86_64</string>
16
+ </array>
17
+ <key>SupportedPlatform</key>
18
+ <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
21
+ </dict>
22
+ <dict>
23
+ <key>LibraryIdentifier</key>
24
+ <string>ios-arm64_armv7</string>
25
+ <key>LibraryPath</key>
26
+ <string>FMDeviceManagerFramework.framework</string>
27
+ <key>SupportedArchitectures</key>
28
+ <array>
29
+ <string>arm64</string>
30
+ <string>armv7</string>
31
+ </array>
32
+ <key>SupportedPlatform</key>
33
+ <string>ios</string>
34
+ </dict>
35
+ </array>
36
+ <key>CFBundlePackageType</key>
37
+ <string>XFWK</string>
38
+ <key>XCFrameworkFormatVersion</key>
39
+ <string>1.0</string>
40
+ </dict>
41
+ </plist>
@@ -0,0 +1,49 @@
1
+ //
2
+ // FMDeviceManager.h
3
+ // FMDeviceManager
4
+ //
5
+ //
6
+ //
7
+
8
+ #define FM_SDK_VERSION @"4.2.7"
9
+
10
+ #import <Foundation/Foundation.h>
11
+
12
+ typedef void(^TDGetBlackBoxAsyncBlock)(NSString* blackBox);
13
+
14
+ typedef void(^TDErrorCodeBlock)(int errorCode, const char*errorMsg);
15
+
16
+ typedef struct FMDeviceManager_Void {
17
+
18
+ void (*initWithOptions)(NSDictionary *);
19
+
20
+ NSString *(*getBlackBox)(void);
21
+
22
+ // manager->getBlackBoxAsync(^(NSString* blackBox){});
23
+ void (*getBlackBoxAsync)(TDGetBlackBoxAsyncBlock block);
24
+
25
+ // manager->setOnErrorCodeListener(^(int errorCode,const char* errorMsg){})
26
+ void (*setOnErrorCodeListener)(TDErrorCodeBlock block);
27
+
28
+ NSString *(*getInitStatus)(void);
29
+
30
+ NSDictionary *(*getConfigInfo)(void);
31
+
32
+ } FMDeviceManager_t;
33
+
34
+ #ifdef SDKTYPE
35
+ #ifdef SAAS
36
+ @interface FMDeviceManager_SAAS : NSObject
37
+ #elif defined(ENTERPRISE)
38
+ @interface FMDeviceManager_ENTERPRISE : NSObject
39
+ #else
40
+ #error "error SDKTYPE"
41
+ #endif
42
+ #else
43
+ @interface FMDeviceManager : NSObject
44
+ #endif
45
+
46
+ + (FMDeviceManager_t *) sharedManager;
47
+
48
+ @end
49
+
@@ -0,0 +1,6 @@
1
+ framework module FMDeviceManagerFramework {
2
+ umbrella header "FMDeviceManager.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }
@@ -0,0 +1,49 @@
1
+ //
2
+ // FMDeviceManager.h
3
+ // FMDeviceManager
4
+ //
5
+ //
6
+ //
7
+
8
+ #define FM_SDK_VERSION @"4.2.7"
9
+
10
+ #import <Foundation/Foundation.h>
11
+
12
+ typedef void(^TDGetBlackBoxAsyncBlock)(NSString* blackBox);
13
+
14
+ typedef void(^TDErrorCodeBlock)(int errorCode, const char*errorMsg);
15
+
16
+ typedef struct FMDeviceManager_Void {
17
+
18
+ void (*initWithOptions)(NSDictionary *);
19
+
20
+ NSString *(*getBlackBox)(void);
21
+
22
+ // manager->getBlackBoxAsync(^(NSString* blackBox){});
23
+ void (*getBlackBoxAsync)(TDGetBlackBoxAsyncBlock block);
24
+
25
+ // manager->setOnErrorCodeListener(^(int errorCode,const char* errorMsg){})
26
+ void (*setOnErrorCodeListener)(TDErrorCodeBlock block);
27
+
28
+ NSString *(*getInitStatus)(void);
29
+
30
+ NSDictionary *(*getConfigInfo)(void);
31
+
32
+ } FMDeviceManager_t;
33
+
34
+ #ifdef SDKTYPE
35
+ #ifdef SAAS
36
+ @interface FMDeviceManager_SAAS : NSObject
37
+ #elif defined(ENTERPRISE)
38
+ @interface FMDeviceManager_ENTERPRISE : NSObject
39
+ #else
40
+ #error "error SDKTYPE"
41
+ #endif
42
+ #else
43
+ @interface FMDeviceManager : NSObject
44
+ #endif
45
+
46
+ + (FMDeviceManager_t *) sharedManager;
47
+
48
+ @end
49
+
@@ -0,0 +1,6 @@
1
+ framework module FMDeviceManagerFramework {
2
+ umbrella header "FMDeviceManager.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }
@@ -0,0 +1,63 @@
1
+ //
2
+ // TDCaptchaManager.h
3
+ // TeeTest
4
+ //
5
+ // Created by vee on 18/2/3.
6
+ // Copyright © 2018年 Tommybiteme. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import <UIKit/UIKit.h>
11
+
12
+ #define TDCAPTCHA_SDK_VERSION @"2.1.8.4"
13
+
14
+ #ifndef TDMOBRISK_SDK_VERSION
15
+ typedef enum {
16
+
17
+ // The Captcha is verified successfully, and a valid validateToken can be obtained at this time;
18
+ TDShowCaptchaResultTypeSuccess,
19
+ // If the Captcha fails, you can get the error code errorCode and errorMsg, and check the cause according to the `Error code` in the document;
20
+ TDShowCaptchaResultTypeFailed,
21
+ // The Captcha window pop-up is successful, waiting to be verified;
22
+ TDShowCaptchaResultTypeReady,
23
+
24
+ } TDShowCaptchaResultType;
25
+
26
+ typedef struct _TDShowCaptchaResultStruct{
27
+
28
+ // return result type
29
+ const TDShowCaptchaResultType resultType;
30
+ // After returning successfully, the token of the Captcha returned
31
+ char* const validateToken;
32
+ // After the return fails, the returned error code can be checked according to the document
33
+ const NSInteger errorCode;
34
+ // Return error message after failure
35
+ char* const errorMsg;
36
+
37
+ }TDShowCaptchaResultStruct;
38
+
39
+ #endif
40
+ typedef void(^TDShowCaptchaBlock)(TDShowCaptchaResultStruct resultStruct);
41
+
42
+
43
+ @interface TDCaptchaManager : NSObject
44
+
45
+ /// 验证码SDK 初始化方法
46
+ /// @param options 验证码初始化参数配置字典
47
+ +(void)initCaptchaOptions:(NSDictionary *)options;
48
+
49
+ /// 显示验证码弹窗方法
50
+ /// @param superView 显示验证码弹窗的父视图
51
+ /// @param token 默认传nil
52
+ /// @param resultBlock 验证码验证结果的回调
53
+ +(void)vertifyCaptchaSuperView:(UIView *_Nonnull)superView andToken:(NSString * _Nullable)token andResult:(_Nonnull TDShowCaptchaBlock)resultBlock;
54
+
55
+ /// 显示验证码弹窗方法
56
+ /// @param superView 显示验证码弹窗的父视图
57
+ /// @param resultBlock 验证码验证结果的回调
58
+ +(void)vertifyCaptchaSuperView:(UIView *_Nonnull)superView andResult:(_Nonnull TDShowCaptchaBlock)resultBlock;
59
+
60
+ /// 版本号
61
+ + (NSString *)getVersion;
62
+
63
+ @end
@@ -0,0 +1 @@
1
+ <html lang=en><head><meta charset=UTF-8><title>Title</title><meta charset=UTF-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=renderer content=webkit><meta name=viewport id=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><style>*{outline:0 solid transparent;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.td-outer-wrapper{display:block!important}.td-pop-cnt.center{transform:translate(0,0)!important;-moz-transform:translate(0,0)!important;-ms-transform:translate(0,0)!important;-webkit-transform:translate(0,0)!important;top:0!important;left:0!important}.td-outer-wrapper{position:static!important}.td-pop-cnt{box-shadow:0 0!important}</style><body><script>function render(t){t&&window._fmWebviewCbk(t)}function setScale(t){_fmOpt.setScale(t)}_fmOpt={webview:!0,display:"bind",needValidateCode:!0};var funFactory=function(t){return function(e,n){try{return"start"===t?window.TDBridge[t](e,n):window.TDBridge[t](e||"default")}catch(a){}finally{}try{return window.webkit.messageHandlers[t].postMessage(e||"default")}catch(a){}finally{}}};_fmOpt.start=funFactory("start"),_fmOpt.get=funFactory("get"),_fmOpt.end=funFactory("end"),_fmOpt.onValidate=funFactory("onValidate"),_fmOpt.close=funFactory("close"),_fmOpt.setType=funFactory("setType"),_fmOpt.show=funFactory("show"),window._fmWebviewCbk=function(t){t=t.split("|");var e=t[4];_fmOpt.validateCodeObj=JSON.parse(e),_fmOpt.token=t[0],_fmOpt.partner=t[1],_fmOpt.appName=t[2],_fmOpt.blackbox=t[3],_fmOpt.version=t[5],_fmOpt.env=t[6],_fmOpt.hideCompInfo=t[7],_fmOpt.lang=t[8],_fmOpt.closeIcon=t[9];var n=t[10];_fmOpt.configInfo=t[11],_fmOpt.initialTime=(new Date).getTime();var a=document.createElement("script");a.type="text/javascript",a.src=n+"/main/tdc.js?t="+(new Date).getTime(),a.onerror=function(){_fmOpt.close&&_fmOpt.close(JSON.stringify({errorCode:"115",errorMsg:"resources load failed."}))};var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(a)};var data=_fmOpt.get();data&&window._fmWebviewCbk(data),window._fmSensorInfoCbk=function(){function t(){try{return new window.XMLHttpRequest}catch(t){}}var e=!1,n=window.ActiveXObject?function(){return new window.ActiveXObject("Microsoft.XMLHTTP")}:t;xhrSupported=n(),e=!!xhrSupported&&"withCredentials"in n,_fmOpt.setType&&_fmOpt.setType(e?"post":"get")};</script>
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>LibraryIdentifier</key>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
+ <key>LibraryPath</key>
11
+ <string>TDMobRisk.framework</string>
12
+ <key>SupportedArchitectures</key>
13
+ <array>
14
+ <string>arm64</string>
15
+ <string>x86_64</string>
16
+ </array>
17
+ <key>SupportedPlatform</key>
18
+ <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
21
+ </dict>
22
+ <dict>
23
+ <key>LibraryIdentifier</key>
24
+ <string>ios-arm64_armv7</string>
25
+ <key>LibraryPath</key>
26
+ <string>TDMobRisk.framework</string>
27
+ <key>SupportedArchitectures</key>
28
+ <array>
29
+ <string>arm64</string>
30
+ <string>armv7</string>
31
+ </array>
32
+ <key>SupportedPlatform</key>
33
+ <string>ios</string>
34
+ </dict>
35
+ </array>
36
+ <key>CFBundlePackageType</key>
37
+ <string>XFWK</string>
38
+ <key>XCFrameworkFormatVersion</key>
39
+ <string>1.0</string>
40
+ </dict>
41
+ </plist>
@@ -0,0 +1,17 @@
1
+ //
2
+ // TDMobRisk.h
3
+ // TDMobRisk
4
+ //
5
+
6
+ #import <Foundation/Foundation.h>
7
+
8
+ //! Project version number for TDMobRisk.
9
+ FOUNDATION_EXPORT double TDMobRiskVersionNumber;
10
+
11
+ //! Project version string for TDMobRisk.
12
+ FOUNDATION_EXPORT const unsigned char TDMobRiskVersionString[];
13
+
14
+ #import "TDMobRiskManager.h"
15
+
16
+
17
+
@@ -0,0 +1,196 @@
1
+ //
2
+ // TDMobRiskManager.h
3
+ // TDMobRisk
4
+ //
5
+
6
+ #import <Foundation/Foundation.h>
7
+
8
+ #define TDMOBRISK_SDK_VERSION @"4.2.7.1"
9
+
10
+ typedef enum {
11
+
12
+ TDLivenessShowStylePush,
13
+
14
+ TDLivenessShowStylePresent,
15
+
16
+ } TDLivenessShowStyle;
17
+
18
+ typedef enum {
19
+
20
+ // The Captcha is verified successfully, and a valid validateToken can be obtained at this time;
21
+ TDShowCaptchaResultTypeSuccess,
22
+ // If the Captcha fails, you can get the error code errorCode and errorMsg, and check the cause according to the `Error code` in the document;
23
+ TDShowCaptchaResultTypeFailed,
24
+ // The Captcha window pop-up is successful, waiting to be verified;
25
+ TDShowCaptchaResultTypeReady,
26
+
27
+ } TDShowCaptchaResultType;
28
+
29
+ typedef void(^TDGetBlackBoxAsyncBlock)(NSString* blackBox);
30
+
31
+ typedef void(^TDErrorCodeBlock)(int errorCode, const char*errorMsg);
32
+
33
+ typedef struct _TDShowCaptchaResultStruct{
34
+
35
+ // return result type
36
+ const TDShowCaptchaResultType resultType;
37
+ // After returning successfully, the token of the Captcha returned
38
+ char* const validateToken;
39
+ // After the return fails, the returned error code can be checked according to the document
40
+ const NSInteger errorCode;
41
+ // Return error message after failure
42
+ char* const errorMsg;
43
+
44
+ }TDShowCaptchaResultStruct;
45
+
46
+ typedef void(^TDShowCaptchaBlock)(TDShowCaptchaResultStruct resultStruct);
47
+
48
+ typedef enum {
49
+
50
+ // The Liveness is verified successfully;
51
+ TDLivenessResultTypeSuccess,
52
+ // If the Liveness fails, you can get the error code errorCode and errorMsg, and check the cause according to the `Error code` in the document;
53
+ TDLivenessResultTypeFailed,
54
+ // The Liveness window pop-up is successful, waiting to be verified;
55
+ TDLivenessResultTypeReady,
56
+
57
+ } TDLivenessResultType;
58
+
59
+ typedef struct _TDLivenessResultStruct{
60
+ // return result type
61
+ const TDLivenessResultType resultType;
62
+ // the seqId of the Liveness returned
63
+ char* const seqId;
64
+ // After the return fails, the returned error code can be checked according to the document
65
+ const NSInteger errorCode;
66
+ // Return error message after failure
67
+ char* const errorMsg;
68
+ // liveness score when success
69
+ double score;
70
+ // best image string
71
+ char* const bestImageString;
72
+
73
+ }TDLivenessResultStruct;
74
+
75
+ typedef void(^TDShowLivenessBlock)(TDLivenessResultStruct resultStruct);
76
+
77
+ typedef struct _TDAPISignResult{
78
+ // sign
79
+ char* sign;
80
+ // After the return fails, the returned error code can be checked according to the document
81
+ int code;
82
+ // Return error message after failure
83
+ char* msg;
84
+ }TDAPISignResult;
85
+
86
+
87
+ typedef struct _tdMobRiskVoid {
88
+ /**
89
+ * Initialization method
90
+ * @param options Initialization parameters,please see the document for details.
91
+ */
92
+ void (*initWithOptions)(NSDictionary *);
93
+ /**
94
+ * get blackBox sync, you should make sure that method calls after initWithOptions.
95
+ */
96
+ NSString *(*getBlackBox)(void);
97
+ /**
98
+ * get blackBox async, you should make sure that method calls after initWithOptions.
99
+ @usage: manager->getBlackBoxAsync(^(NSString* blackBox){});
100
+ */
101
+ void (*getBlackBoxAsync)(TDGetBlackBoxAsyncBlock block);
102
+ /**
103
+ * listen error code, use it before initWithOptions
104
+ @usage: manager->setOnErrorCodeListener(^(int errorCode,const char* errorMsg){})
105
+ */
106
+ void (*setOnErrorCodeListener)(TDErrorCodeBlock block);
107
+ /**
108
+ * Display Captcha window
109
+ * @usage: manager->showCaptcha(self.view,^(TDShowCaptchaResultStruct resultStruct) {
110
+ * });
111
+ * @param superView The parent view where the popup is displayed, UIView type
112
+ * @param block result callback block
113
+ */
114
+ void (*showCaptcha)(id superView,TDShowCaptchaBlock block);
115
+
116
+ /**
117
+ * Display Captcha window
118
+ * @usage: manager->showCaptcha(self.view,^(TDShowCaptchaResultStruct resultStruct) {
119
+ * });
120
+ * @param superView The parent view where the popup is displayed, UIView type
121
+ * @param sceneToken scene token
122
+ * @param block result callback block
123
+ */
124
+ void (*showCaptchaWithToken)(id superView,NSString* sceneToken,TDShowCaptchaBlock block);
125
+
126
+ /**
127
+ * Display Liveness window, will use [targetVC.navigationController pushViewController:lvctl animated:YES]; to show
128
+ * @usage: manager->showLivenessWithShowStyle(self,TDLivenessShowStylePresent,^(TDLivenessResultStruct resultStruct) {
129
+ * });
130
+ * @param targetVC The parent view where the popup is displayed, UIViewController type
131
+ * @param block result callback block
132
+ */
133
+ void (*showLiveness)(id targetVC,TDShowLivenessBlock block);
134
+
135
+ /**
136
+ * Display Liveness window
137
+ * @usage: manager->showLivenessWithShowStyle(self,nil,TDLivenessShowStylePresent,^(TDLivenessResultStruct resultStruct) {
138
+ * });
139
+ * @param targetVC The parent view where the popup is displayed, UIViewController type
140
+ * @param license auth license,can be nil
141
+ * @param showStyle TDLivenessShowStylePush or TDLivenessShowStylePresent
142
+ * @param block result callback block
143
+ */
144
+ void (*showLivenessWithShowStyle)(id targetVC,NSString* _Nullable license,TDLivenessShowStyle showStyle,TDShowLivenessBlock block);
145
+
146
+ /**
147
+ * upload probe data
148
+ */
149
+ void (*upload)(void);
150
+
151
+ /**
152
+ * start
153
+ */
154
+ NSString* (*start)(void);
155
+
156
+ /**
157
+ * stop
158
+ */
159
+ BOOL (*stop)(void);
160
+
161
+ /**
162
+ * getEid
163
+ */
164
+ NSString* (*getEid)(void);
165
+
166
+ /**
167
+ * Sign the queryDictionary parameter dictionary under the path
168
+ * @usage: const char* sign = manager->signWithQuery(@"login",@{@"name" : @"xiaoming"});
169
+ * @param path: network request path, such as: @"login"
170
+ * @param queryDictionary: network request parameter dictionary, such as: @{@"name" : @"xiaoming"}
171
+ */
172
+ TDAPISignResult (*signWithQuery)(NSString *path, NSDictionary<NSString*,NSString*> *queryDictionary);
173
+
174
+ /**
175
+ * Sign the queryDictionary parameter dictionary under the path
176
+ * @usage: const char* sign = manager->signWithQuery(@"login",@{@"name" : @"xiaoming"});
177
+ * @param path: network request path, such as: @"login"
178
+ * @param body: network request body string, such as: @"name=xiaoming"
179
+ */
180
+
181
+ TDAPISignResult (*signWithBody)(NSString *path, NSString *body);
182
+
183
+ /**
184
+ * get sdkVersion
185
+ */
186
+ NSString *(*getSDKVersion)(void);
187
+
188
+ } TDMobRiskManager_t;
189
+
190
+ @interface TDMobRiskManager : NSObject
191
+ /**
192
+ * get a singleton object
193
+ */
194
+ + (TDMobRiskManager_t *)sharedManager;
195
+
196
+ @end
@@ -0,0 +1,6 @@
1
+ framework module TDMobRisk {
2
+ umbrella header "TDMobRisk.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }