com.taptap.sdk.compliance 4.3.2 → 4.3.8-alpha.2

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.
@@ -5,14 +5,14 @@
5
5
  <repositories>
6
6
  <repository>https://repo.maven.apache.org/maven2</repository>
7
7
  </repositories>
8
- <androidPackage spec="com.taptap.sdk:tap-compliance:4.3.2"/>
8
+ <androidPackage spec="com.taptap.sdk:tap-compliance:4.3.8-alpha.11"/>
9
9
  </androidPackages>
10
10
 
11
11
  <!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
12
12
  <iosPods>
13
13
  <sources>
14
- <source>https://github.com/CocoaPods/Specs.git</source>
14
+ <source>git@git.gametaptap.com:ios/international/TapSDK4-iOS-podspecs.git</source>
15
15
  </sources>
16
- <iosPod name="TapTapComplianceSDK" version="~> 4.3.2" bitcodeEnabled="false" addToAllTargets="false"/>
16
+ <iosPod name="TapTapComplianceSDK" version="~> 4.3.8-alpha.1" bitcodeEnabled="false" addToAllTargets="false"/>
17
17
  </iosPods>
18
18
  </dependencies>
@@ -10,6 +10,8 @@ namespace TapSDK.Compliance
10
10
  public static class TapTapCompliance
11
11
  {
12
12
 
13
+ public static readonly string Version = "4.3.4";
14
+
13
15
  public static void RegisterComplianceCallback(Action<int, string> callback)
14
16
  {
15
17
  if (ComplianceJobManager.IsInit() == false) {
@@ -4,6 +4,7 @@ using TapSDK.Login;
4
4
  using TapSDK.Compliance.Internal;
5
5
  using TapSDK.Compliance.Model;
6
6
  using System.Collections.Generic;
7
+ using TapSDK.Compliance.Standalone.Internal;
7
8
 
8
9
  namespace TapSDK.Compliance
9
10
  {
@@ -69,6 +70,7 @@ namespace TapSDK.Compliance
69
70
  public void Init(string clientId, string clientToken, TapTapComplianceOption config) {
70
71
  UseAgeRange = config.useAgeRange;
71
72
  TapTapComplianceManager.Init(clientId, clientToken, config);
73
+ TapComplianceTracker.Instance.TrackInit();
72
74
  }
73
75
 
74
76
  public void RegisterComplianceCallback(Action<int, string> callback){
@@ -83,10 +85,28 @@ namespace TapSDK.Compliance
83
85
 
84
86
  public async void Startup(string userId)
85
87
  {
88
+ string sessionId = Guid.NewGuid().ToString();
89
+ TapComplianceTracker.Instance.TrackStart("startup", sessionId);
86
90
  if(TapTapComplianceManager.UserId != null){
87
91
  TapTapComplianceManager.ClearUserCache();
88
92
  }
89
93
  var code = await TapTapComplianceManager.StartUp(userId);
94
+ switch(code){
95
+ case StartUpResult.LOGIN_SUCCESS:
96
+ case StartUpResult.PERIOD_RESTRICT:
97
+ case StartUpResult.DURATION_LIMIT:
98
+ case StartUpResult.AGE_LIMIT:
99
+ TapComplianceTracker.Instance.TrackSuccess("startup", sessionId);
100
+ break;
101
+ case StartUpResult.INVALID_CLIENT_OR_NETWORK_ERROR:
102
+ TapComplianceTracker.Instance.TrackFailure("startup", sessionId, code, "invalid client or network error");
103
+ break;
104
+ case StartUpResult.EXITED:
105
+ case StartUpResult.SWITCH_ACCOUNT:
106
+ break;
107
+ }
108
+ if (StartUpResult.Contains(code)){
109
+ }
90
110
  OnInvokeExternalCallback(code,null);
91
111
  }
92
112
 
@@ -24,8 +24,6 @@ namespace TapSDK.Compliance.Internal.Http {
24
24
 
25
25
  private readonly Dictionary<string, string> additionalHeaders = new Dictionary<string, string>();
26
26
 
27
-
28
-
29
27
  public ComplianceHttpClient(string serverUrl) {
30
28
  this.serverUrl = serverUrl;
31
29
  client = new HttpClient();
@@ -253,9 +253,9 @@ namespace TapSDK.Compliance.Internal
253
253
  { "X-Tap-Device-Id", SystemInfo.deviceUniqueIdentifier},
254
254
  { "X-Tap-Platform", "PC"},
255
255
  { "X-Tap-SDK-Module","TapCompliance"},
256
- { "X-Tap-SDK-Module-Version", TapTapSDK.SDKVersion},
256
+ { "X-Tap-SDK-Module-Version", TapTapSDK.Version},
257
257
  { "X-Tap-SDK-Artifact", "Unity"},
258
- { "User-Agent","TapSDK-Unity/" + TapTapSDK.SDKVersion},
258
+ { "User-Agent","TapSDK-Unity/" + TapTapSDK.Version},
259
259
  { "X-Tap-Nonce", nonce},
260
260
  { "X-Tap-Ts",ts}
261
261
  };
@@ -0,0 +1,103 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using Newtonsoft.Json;
4
+ using TapSDK.Core.Standalone.Internal.Openlog;
5
+
6
+ namespace TapSDK.Compliance.Standalone.Internal
7
+ {
8
+ internal class TapComplianceTracker
9
+ {
10
+
11
+ private const string ACTION_INIT = "init";
12
+ private const string ACTION_START = "start";
13
+ private const string ACTION_SUCCESS = "success";
14
+ private const string ACTION_FAIL = "fail";
15
+ private const string ACTION_CANCEL = "cancel";
16
+
17
+ private static TapComplianceTracker instance;
18
+
19
+ private TapOpenlogStandalone openlog;
20
+
21
+ private TapComplianceTracker()
22
+ {
23
+ openlog = new TapOpenlogStandalone("TapCompliance", TapTapCompliance.Version);
24
+ }
25
+
26
+ public static TapComplianceTracker Instance
27
+ {
28
+ get
29
+ {
30
+ if (instance == null)
31
+ {
32
+ instance = new TapComplianceTracker();
33
+ }
34
+ return instance;
35
+ }
36
+ }
37
+
38
+ internal void TrackInit()
39
+ {
40
+ ReportLog(ACTION_INIT);
41
+ }
42
+
43
+ internal void TrackStart(string funcNace, string seesionId)
44
+ {
45
+ Dictionary<string, string> parameters = new Dictionary<string, string>
46
+ {
47
+ { "func_name", funcNace },
48
+ { "seesion_id", seesionId },
49
+ };
50
+ ReportLog(ACTION_START, new Dictionary<string, string>()
51
+ {
52
+ { "args", JsonConvert.SerializeObject(parameters) }
53
+ });
54
+ }
55
+
56
+ internal void TrackSuccess(string funcNace, string seesionId)
57
+ {
58
+ Dictionary<string, string> parameters = new Dictionary<string, string>
59
+ {
60
+ { "func_name", funcNace },
61
+ { "seesion_id", seesionId }
62
+ };
63
+ ReportLog(ACTION_SUCCESS, new Dictionary<string, string>()
64
+ {
65
+ { "args", JsonConvert.SerializeObject(parameters) }
66
+ });
67
+ }
68
+
69
+ internal void TrackCancel(string funcNace, string seesionId)
70
+ {
71
+ Dictionary<string, string> parameters = new Dictionary<string, string>
72
+ {
73
+ { "func_name", funcNace },
74
+ { "seesion_id", seesionId },
75
+ };
76
+ ReportLog(ACTION_CANCEL, new Dictionary<string, string>()
77
+ {
78
+ { "args", JsonConvert.SerializeObject(parameters) }
79
+ });
80
+ }
81
+
82
+ internal void TrackFailure(string funcNace, string seesionId, int errorCode = -1, string errorMessage = null)
83
+ {
84
+ Dictionary<string, string> parameters = new Dictionary<string, string>
85
+ {
86
+ { "func_name", funcNace },
87
+ { "seesion_id", seesionId },
88
+ { "error_code", errorCode.ToString() },
89
+ { "error_msg", errorMessage }
90
+ };
91
+ ReportLog(ACTION_FAIL, new Dictionary<string, string>()
92
+ {
93
+ { "args", JsonConvert.SerializeObject(parameters) }
94
+ });
95
+ }
96
+
97
+
98
+ private void ReportLog(string action, Dictionary<string, string> parameters = null)
99
+ {
100
+ openlog.LogBusiness(action, parameters);
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: afb7267533f2b47ac9967f0c98205b2b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: d879e2179b79147d2bd211a51ff3aa90
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/link.xml ADDED
@@ -0,0 +1,5 @@
1
+ <linker>
2
+ <assembly fullname="TapSDK.Compliance" preserve="all" />
3
+ <assembly fullname="TapSDK.Compliance.Runtime" preserve="all" />
4
+ <assembly fullname="TapSDK.Compliance.Mobile.Runtime" preserve="all" />
5
+ </linker>
package/link.xml.meta ADDED
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 4304982c3b734421d9db5a3a6b17c98a
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/package.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "name": "com.taptap.sdk.compliance",
3
3
  "displayName": "TapTapSDK Compliance",
4
4
  "description": "TapTapSDK Compliance",
5
- "version": "4.3.2",
5
+ "version": "4.3.8-alpha.2",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.taptap.sdk.core": "4.3.2",
10
- "com.taptap.sdk.login": "4.3.2"
9
+ "com.taptap.sdk.core": "4.3.8-alpha.2",
10
+ "com.taptap.sdk.login": "4.3.8-alpha.2"
11
11
  }
12
12
  }