com.taptap.sdk.rep 4.9.0

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.
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <dependencies>
3
+ <androidPackages>
4
+ <repositories>
5
+ <repository>https://repo.maven.apache.org/maven2</repository>
6
+ </repositories>
7
+ <androidPackage spec="com.taptap.sdk:tap-rep:4.9.0"/>
8
+ </androidPackages>
9
+ <iosPods>
10
+ <sources>
11
+ <source>https://github.com/CocoaPods/Specs.git</source>
12
+ </sources>
13
+ <iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapSDK/Rep" version="4.9.0"/>
14
+ </iosPods>
15
+ </dependencies>
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: bba31c891afb64b0da322d384c9ea210
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,19 @@
1
+ using System;
2
+ using UnityEditor.Build.Reporting;
3
+ using TapSDK.Core.Editor;
4
+
5
+ namespace TapSDK.Rep.Mobile.Editor {
6
+ public class TapRepMobileProcessBuild : SDKLinkProcessBuild {
7
+ public override int callbackOrder => 0;
8
+
9
+ public override string LinkPath => "TapSDK/Rep/link.xml";
10
+
11
+ public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
12
+ new LinkedAssembly { Fullname = "TapSDK.Rep.Mobile.Runtime" }
13
+ };
14
+
15
+ public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
16
+ return BuildTargetUtils.IsSupportMobile(report.summary.platform);
17
+ };
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6216aab019bcf4d82a697daa4d99ba1e
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,17 @@
1
+ {
2
+ "name": "TapSDK.Rep.Mobile.Editor",
3
+ "references": [
4
+ "TapSDK.Core.Editor"
5
+ ],
6
+ "includePlatforms": [
7
+ "Editor"
8
+ ],
9
+ "excludePlatforms": [],
10
+ "allowUnsafeCode": false,
11
+ "overrideReferences": false,
12
+ "precompiledReferences": [],
13
+ "autoReferenced": true,
14
+ "defineConstraints": [],
15
+ "versionDefines": [],
16
+ "noEngineReferences": false
17
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 0d78c6631531242e99844b6c38e9c9e3
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: e0636e29898d8437b846d07dce9d4aef
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,63 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using TapSDK.Core;
4
+ using TapSDK.Core.Internal.Log;
5
+ using TapSDK.Core.Internal.Utils;
6
+ using TapSDK.Rep.Internal;
7
+
8
+ namespace TapSDK.Rep.Mobile {
9
+ public class TapRepMobile : ITapRepBridge {
10
+ public static string TAP_REP_SERVICE = "BridgeRepService";
11
+
12
+ public static string TDS_REP_SERVICE_CLZ = "com.taptap.sdk.rep.enginebridge.BridgeRepService";
13
+
14
+ public static string TDS_REP_SERVICE_IMPL = "com.taptap.sdk.rep.enginebridge.BridgeRepServiceImpl";
15
+
16
+ public TapRepMobile() {
17
+ EngineBridge.GetInstance().Register(TDS_REP_SERVICE_CLZ, TDS_REP_SERVICE_IMPL);
18
+ }
19
+
20
+ public void Init() {
21
+ TapLog.Log("TapRep Mobile Bridge Initialized");
22
+ }
23
+
24
+ public void Open(string openUrl, Action<int, string> callback) {
25
+ TapLog.Log($"TapRep::Open called with openUrl: {openUrl}");
26
+
27
+ var command = new Command.Builder()
28
+ .Service(TAP_REP_SERVICE)
29
+ .Method("open")
30
+ .Args("openUrl", openUrl)
31
+ .Callback(true)
32
+ .OnceTime(true)
33
+ .CommandBuilder();
34
+
35
+ EngineBridge.GetInstance().CallHandler(command, (result) => {
36
+ TapLog.Log($"TapRep::Open result code: {result.code}, content: {result.content}");
37
+
38
+ try {
39
+ if (result.code == Result.RESULT_SUCCESS) {
40
+ // Parse the native result JSON
41
+ // Expected format: {"code": 0, "message": null} or {"code": errorCode, "message": "error"}
42
+ var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
43
+ if (dic != null && dic.ContainsKey("code")) {
44
+ int code = SafeDictionary.GetValue<int>(dic, "code", -1);
45
+ string message = SafeDictionary.GetValue<string>(dic, "message", null);
46
+
47
+ callback?.Invoke(code, message);
48
+ } else {
49
+ // Fallback: if we can't parse, but bridge succeeded, treat as success
50
+ callback?.Invoke(0, null);
51
+ }
52
+ } else {
53
+ // Bridge call failed
54
+ callback?.Invoke(result.code, result.content);
55
+ }
56
+ } catch (Exception e) {
57
+ TapLog.Error($"TapRep::Open parse result error: {e.Message}");
58
+ callback?.Invoke(-1, e.Message);
59
+ }
60
+ });
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: b964413fdc71741c89f7596d113352e9
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,20 @@
1
+ {
2
+ "name": "TapSDK.Rep.Mobile.Runtime",
3
+ "references": [
4
+ "TapSDK.Rep.Runtime",
5
+ "TapSDK.Core.Runtime",
6
+ "TapSDK.Core.Mobile.Runtime"
7
+ ],
8
+ "includePlatforms": [
9
+ "Android",
10
+ "iOS"
11
+ ],
12
+ "excludePlatforms": [],
13
+ "allowUnsafeCode": false,
14
+ "overrideReferences": false,
15
+ "precompiledReferences": [],
16
+ "autoReferenced": true,
17
+ "defineConstraints": [],
18
+ "versionDefines": [],
19
+ "noEngineReferences": false
20
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 22c1f81b8cacf48aeb945d7b4a7b7ae3
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: b83a01b6adfa04ca4abc3abf435d657c
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/Mobile.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: e4afc1ff5113d4c998cc46035c9f1d0c
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ using System;
2
+
3
+ namespace TapSDK.Rep.Internal {
4
+ public interface ITapRepBridge {
5
+ void Init();
6
+ void Open(string openUrl, Action<int, string> callback);
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0cedc190803fa4f9bac1a5694494f98a
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,18 @@
1
+ using TapSDK.Core;
2
+ using TapSDK.Core.Internal.Init;
3
+
4
+ namespace TapSDK.Rep.Internal.Init
5
+ {
6
+ public sealed class TapRepInitTask : IInitTask
7
+ {
8
+ public int Order => 18;
9
+
10
+ public void Init(TapTapSdkOptions coreOption)
11
+ {
12
+ }
13
+
14
+ public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
15
+ {
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 7e8a36acd3e4941a191f8be0296f4394
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: d375c792b464f418295e9d403521a594
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,47 @@
1
+ using System;
2
+ using TapSDK.Core;
3
+ using TapSDK.Core.Internal.Utils;
4
+ using TapSDK.Rep.Internal;
5
+
6
+ namespace TapSDK.Rep {
7
+ /// <summary>
8
+ /// TapTapRep 错误码
9
+ /// </summary>
10
+ public static class TapRepError {
11
+ /// <summary>参数错误</summary>
12
+ public const int PARAM_ERROR = 100002;
13
+ /// <summary>客户端配置错误</summary>
14
+ public const int CLIENT_ERROR = 100003;
15
+ /// <summary>未知错误</summary>
16
+ public const int UNKNOWN_ERROR = 100004;
17
+ }
18
+
19
+ /// <summary>
20
+ /// TapTapRep 主类
21
+ /// </summary>
22
+ public class TapTapRep {
23
+ public static readonly string Version = "4.9.0";
24
+
25
+ static readonly ITapRepBridge repBridge;
26
+
27
+ static TapTapRep() {
28
+ repBridge = BridgeUtils.CreateBridgeImplementation(typeof(ITapRepBridge), "TapSDK.Rep")
29
+ as ITapRepBridge;
30
+ repBridge?.Init();
31
+ }
32
+
33
+ /// <summary>
34
+ /// 打开指定URL
35
+ /// </summary>
36
+ /// <param name="openUrl">要打开的URL地址</param>
37
+ /// <param name="callback">回调,errorCode: 0表示成功,其他值表示失败;errorMessage: 错误信息</param>
38
+ public static void Open(string openUrl, Action<int, string> callback) {
39
+ if (string.IsNullOrEmpty(openUrl)) {
40
+ callback?.Invoke(TapRepError.PARAM_ERROR, "openUrl cannot be null or empty");
41
+ return;
42
+ }
43
+
44
+ repBridge?.Open(openUrl, callback);
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 630b901d2fd0d413689fe093524fe0a4
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: d134dd0b9eebf4714bb08ce2acc49fe6
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "TapSDK.Rep.Runtime",
3
+ "references": [
4
+ "GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
5
+ ],
6
+ "includePlatforms": [],
7
+ "excludePlatforms": [],
8
+ "allowUnsafeCode": false,
9
+ "overrideReferences": false,
10
+ "precompiledReferences": [],
11
+ "autoReferenced": true,
12
+ "defineConstraints": [],
13
+ "versionDefines": [],
14
+ "noEngineReferences": false
15
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 2c315ea4f45214cab954bfe288ed9bb0
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Runtime.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 792a90776c1b54fa0880780de0632e10
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "com.taptap.sdk.rep",
3
+ "displayName": "TapTapSDK Rep",
4
+ "description": "TapTapSDK Rep",
5
+ "version": "4.9.0",
6
+ "unity": "2019.4",
7
+ "license": "MIT",
8
+ "dependencies": {
9
+ "com.taptap.sdk.core": "4.9.0"
10
+ }
11
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 904a1b9178daf40938b337e11a18cfd0
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: