update
This commit is contained in:
51
Assets/TapSDK/Core/Mobile/Runtime/AndroidNativeWrapper.cs
Normal file
51
Assets/TapSDK/Core/Mobile/Runtime/AndroidNativeWrapper.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using TapSDK.Core;
|
||||
using TapSDK.Core.Internal;
|
||||
using System.Collections.Generic;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
|
||||
namespace TapSDK.Core.Mobile{
|
||||
internal class AndroidNativeWrapper
|
||||
{
|
||||
private static AndroidJavaClass tapTapEventClass;
|
||||
|
||||
public static void RegisterDynamicProperties(Func<string> callback)
|
||||
{
|
||||
tapTapEventClass = new AndroidJavaClass("com.taptap.sdk.core.TapTapEvent");
|
||||
AndroidJavaProxy dynamicPropertiesProxy = new TapEventDynamicPropertiesProxy(callback);
|
||||
tapTapEventClass.CallStatic("registerDynamicProperties", dynamicPropertiesProxy);
|
||||
}
|
||||
|
||||
private class TapEventDynamicPropertiesProxy : AndroidJavaProxy
|
||||
{
|
||||
private Func<string> callback;
|
||||
|
||||
public TapEventDynamicPropertiesProxy(Func<string> callback)
|
||||
: base("com.taptap.sdk.core.TapTapEvent$TapEventDynamicProperties")
|
||||
{
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public AndroidJavaObject getDynamicProperties()
|
||||
{
|
||||
try
|
||||
{
|
||||
string json = callback();
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
{
|
||||
return new AndroidJavaObject("org.json.JSONObject", json);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TapLog.Error("Failed to get dynamic properties: " + e.Message);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da60c9deeb9b14586a7e4a0eec603fbb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
84
Assets/TapSDK/Core/Mobile/Runtime/Bridge.cs
Normal file
84
Assets/TapSDK/Core/Mobile/Runtime/Bridge.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public class EngineBridge
|
||||
{
|
||||
private static volatile EngineBridge _sInstance;
|
||||
|
||||
private readonly IBridge _bridge;
|
||||
|
||||
private static readonly object Locker = new object();
|
||||
|
||||
public static EngineBridge GetInstance()
|
||||
{
|
||||
lock (Locker)
|
||||
{
|
||||
if (_sInstance == null)
|
||||
{
|
||||
_sInstance = new EngineBridge();
|
||||
}
|
||||
}
|
||||
|
||||
return _sInstance;
|
||||
}
|
||||
|
||||
private EngineBridge()
|
||||
{
|
||||
if (Platform.IsAndroid())
|
||||
{
|
||||
_bridge = BridgeAndroid.GetInstance();
|
||||
}
|
||||
else if (Platform.IsIOS())
|
||||
{
|
||||
_bridge = BridgeIOS.GetInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public void Register(string serviceClzName, string serviceImplName)
|
||||
{
|
||||
_bridge?.Register(serviceClzName, serviceImplName);
|
||||
}
|
||||
|
||||
public void CallHandler(Command command)
|
||||
{
|
||||
_bridge?.Call(command);
|
||||
}
|
||||
|
||||
public string CallWithReturnValue(Command command, Action<Result> action = null)
|
||||
{
|
||||
return _bridge?.CallWithReturnValue(command, action);
|
||||
}
|
||||
|
||||
public void CallHandler(Command command, Action<Result> action)
|
||||
{
|
||||
_bridge?.Call(command, action);
|
||||
}
|
||||
|
||||
public Task<Result> Emit(Command command)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<Result>();
|
||||
CallHandler(command, result =>
|
||||
{
|
||||
tcs.TrySetResult(result);
|
||||
});
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
public static bool CheckResult(Result result)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result.code != Result.RESULT_SUCCESS)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !string.IsNullOrEmpty(result.content);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/Bridge.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/Bridge.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 168155d160dc0448bb9f57e609c284af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
74
Assets/TapSDK/Core/Mobile/Runtime/BridgeAndroid.cs
Normal file
74
Assets/TapSDK/Core/Mobile/Runtime/BridgeAndroid.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public class BridgeAndroid : IBridge
|
||||
{
|
||||
private string bridgeJavaClz = "com.taptap.sdk.kit.internal.enginebridge.EngineBridge";
|
||||
|
||||
private string instanceField = "INSTANCE";
|
||||
|
||||
private string registerHandlerMethod = "registerHandler";
|
||||
|
||||
private string callHandlerMethod = "execCommand";
|
||||
|
||||
private string callHandlerAsyncMethod = "execCommandAsync";
|
||||
|
||||
private string initMethod = "init";
|
||||
|
||||
private string registerMethod = "registerService";
|
||||
|
||||
private readonly AndroidJavaObject _mAndroidBridge;
|
||||
|
||||
private static readonly BridgeAndroid SInstance = new BridgeAndroid();
|
||||
|
||||
public static BridgeAndroid GetInstance()
|
||||
{
|
||||
return SInstance;
|
||||
}
|
||||
|
||||
private BridgeAndroid()
|
||||
{
|
||||
var mCurrentActivity =
|
||||
new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
|
||||
_mAndroidBridge = new AndroidJavaClass(bridgeJavaClz).GetStatic<AndroidJavaObject>(instanceField);
|
||||
_mAndroidBridge.Call(initMethod, mCurrentActivity);
|
||||
}
|
||||
|
||||
public void Register(string serviceClzName, string serviceImplName)
|
||||
{
|
||||
if (_mAndroidBridge == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var serviceClass = new AndroidJavaClass(serviceClzName);
|
||||
var serviceImpl = new AndroidJavaObject(serviceImplName);
|
||||
_mAndroidBridge.Call(registerMethod, serviceClass, serviceImpl);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TapLog.Log("register Failed:" + e);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
public void Call(Command command, Action<Result> action)
|
||||
{
|
||||
_mAndroidBridge?.Call(callHandlerMethod, command.ToJSON(), new BridgeCallback(action));
|
||||
}
|
||||
|
||||
public void Call(Command command)
|
||||
{
|
||||
_mAndroidBridge?.Call(callHandlerMethod, command.ToJSON(), null);
|
||||
}
|
||||
public string CallWithReturnValue(Command command, Action<Result> action)
|
||||
{
|
||||
return _mAndroidBridge?.Call<string>(callHandlerAsyncMethod, command.ToJSON());
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeAndroid.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeAndroid.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f691a68724f14b63b7c60ac2f967488
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
35
Assets/TapSDK/Core/Mobile/Runtime/BridgeCallback.cs
Normal file
35
Assets/TapSDK/Core/Mobile/Runtime/BridgeCallback.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Threading;
|
||||
using TapSDK.Core.Internal.Utils;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
|
||||
public class BridgeCallback : AndroidJavaProxy
|
||||
{
|
||||
Action<Result> callback;
|
||||
|
||||
public BridgeCallback(Action<Result> action) :
|
||||
base(new AndroidJavaClass("com.taptap.sdk.kit.internal.enginebridge.EngineBridgeCallback"))
|
||||
{
|
||||
this.callback = action;
|
||||
}
|
||||
|
||||
public override AndroidJavaObject Invoke(string method, object[] args)
|
||||
{
|
||||
if (method.Equals("onResult"))
|
||||
{
|
||||
if (args[0] is string)
|
||||
{
|
||||
string result = (string)(args[0]);
|
||||
TapLoom.QueueOnMainThread(() =>
|
||||
{
|
||||
callback(new Result(result));
|
||||
});
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeCallback.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeCallback.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5ce170f9f3e64033909f7513e067032
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
123
Assets/TapSDK/Core/Mobile/Runtime/BridgeIOS.cs
Normal file
123
Assets/TapSDK/Core/Mobile/Runtime/BridgeIOS.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public class BridgeIOS : IBridge
|
||||
{
|
||||
private static readonly BridgeIOS SInstance = new BridgeIOS();
|
||||
|
||||
private readonly ConcurrentDictionary<string, Action<Result>> dic;
|
||||
|
||||
public static BridgeIOS GetInstance()
|
||||
{
|
||||
return SInstance;
|
||||
}
|
||||
|
||||
private BridgeIOS()
|
||||
{
|
||||
dic = new ConcurrentDictionary<string, Action<Result>>();
|
||||
}
|
||||
|
||||
private ConcurrentDictionary<string, Action<Result>> GetConcurrentDictionary()
|
||||
{
|
||||
return dic;
|
||||
}
|
||||
|
||||
private delegate void EngineBridgeDelegate(string result);
|
||||
|
||||
[AOT.MonoPInvokeCallbackAttribute(typeof(EngineBridgeDelegate))]
|
||||
static void engineBridgeDelegate(string resultJson)
|
||||
{
|
||||
var result = new Result(resultJson);
|
||||
|
||||
var actionDic = GetInstance().GetConcurrentDictionary();
|
||||
|
||||
Action<Result> action = null;
|
||||
|
||||
// 修复:检查callbackId是否为null或空,防止ArgumentNullException
|
||||
if (actionDic != null && !string.IsNullOrEmpty(result.callbackId) && actionDic.ContainsKey(result.callbackId))
|
||||
{
|
||||
action = actionDic[result.callbackId];
|
||||
}
|
||||
|
||||
if (action != null)
|
||||
{
|
||||
action(result);
|
||||
if (result.onceTime && !string.IsNullOrEmpty(result.callbackId) && BridgeIOS.GetInstance().GetConcurrentDictionary()
|
||||
.TryRemove(result.callbackId, out Action<Result> outAction))
|
||||
{
|
||||
TapLog.Log($"TapSDK resolved current Action:{result.callbackId}");
|
||||
}
|
||||
}
|
||||
else if (string.IsNullOrEmpty(result.callbackId))
|
||||
{
|
||||
// 记录调试信息:当callbackId为空时
|
||||
TapLog.Log($"TapSDK received result without callbackId, result: {resultJson}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 记录调试信息:当找不到对应的action时
|
||||
TapLog.Log($"TapSDK no action found for callbackId: {result.callbackId}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Register(string serviceClz, string serviceImp)
|
||||
{
|
||||
//IOS无需注册
|
||||
}
|
||||
|
||||
public void Call(Command command)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
callHandler(command.ToJSON());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Call(Command command, Action<Result> action)
|
||||
{
|
||||
if (!command.withCallback || string.IsNullOrEmpty(command.callbackId)) return;
|
||||
if (!dic.ContainsKey(command.callbackId))
|
||||
{
|
||||
dic.GetOrAdd(command.callbackId, action);
|
||||
}
|
||||
#if UNITY_IOS
|
||||
registerHandler(command.ToJSON(), engineBridgeDelegate);
|
||||
#endif
|
||||
}
|
||||
|
||||
public string CallWithReturnValue(Command command, Action<Result> action)
|
||||
{
|
||||
if (command.callbackId != null && !dic.ContainsKey(command.callbackId))
|
||||
{
|
||||
dic.GetOrAdd(command.callbackId, action);
|
||||
}
|
||||
#if UNITY_IOS
|
||||
if (action == null)
|
||||
{
|
||||
return callWithReturnValue(command.ToJSON(), null);
|
||||
} else {
|
||||
return callWithReturnValue(command.ToJSON(), engineBridgeDelegate);
|
||||
}
|
||||
#else
|
||||
return null;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern string callWithReturnValue(string command, EngineBridgeDelegate engineBridgeDelegate);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void callHandler(string command);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void registerHandler(string command, EngineBridgeDelegate engineBridgeDelegate);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeIOS.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/BridgeIOS.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a02205ed9346141f29e5729b12bae65a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
119
Assets/TapSDK/Core/Mobile/Runtime/Command.cs
Normal file
119
Assets/TapSDK/Core/Mobile/Runtime/Command.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public class Command
|
||||
{
|
||||
[SerializeField] public string service;
|
||||
[SerializeField] public string method;
|
||||
[SerializeField] public string args;
|
||||
[SerializeField] public bool withCallback;
|
||||
[SerializeField] public string callbackId;
|
||||
[SerializeField] public bool disposable;
|
||||
|
||||
public Command()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Command(string json)
|
||||
{
|
||||
JsonUtility.FromJsonOverwrite(json, this);
|
||||
}
|
||||
|
||||
public string ToJSON()
|
||||
{
|
||||
return JsonUtility.ToJson(this);
|
||||
}
|
||||
|
||||
public Command(string service, string method, bool callback, Dictionary<string, object> dic)
|
||||
{
|
||||
this.args = dic == null ? null : Json.Serialize(dic);
|
||||
this.service = service;
|
||||
this.method = method;
|
||||
this.withCallback = callback;
|
||||
this.callbackId = this.withCallback ? TapUUID.UUID() : null;
|
||||
}
|
||||
|
||||
public Command(string service, string method, bool callback, bool onceTime, Dictionary<string, object> dic)
|
||||
{
|
||||
this.args = dic == null ? null : Json.Serialize(dic);
|
||||
this.service = service;
|
||||
this.method = method;
|
||||
this.withCallback = callback;
|
||||
this.callbackId = this.withCallback ? TapUUID.UUID() : null;
|
||||
this.disposable = onceTime;
|
||||
}
|
||||
|
||||
public class Builder
|
||||
{
|
||||
private string service;
|
||||
|
||||
private string method;
|
||||
|
||||
private bool withCallback;
|
||||
|
||||
private string callbackId;
|
||||
|
||||
private bool disposable;
|
||||
|
||||
private Dictionary<string, object> args;
|
||||
|
||||
public Builder()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Builder Service(string service)
|
||||
{
|
||||
this.service = service;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder Method(string method)
|
||||
{
|
||||
this.method = method;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder OnceTime(bool onceTime)
|
||||
{
|
||||
this.disposable = onceTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder Args(Dictionary<string, object> dic)
|
||||
{
|
||||
this.args = dic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder Args(string key, object value)
|
||||
{
|
||||
if (this.args == null)
|
||||
{
|
||||
this.args = new Dictionary<string, object>();
|
||||
}
|
||||
if(value is Dictionary<string,object>)
|
||||
{
|
||||
value = Json.Serialize(value);
|
||||
}
|
||||
this.args.Add(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder Callback(bool callback)
|
||||
{
|
||||
this.withCallback = callback;
|
||||
this.callbackId = this.withCallback ? TapUUID.UUID() : null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Command CommandBuilder()
|
||||
{
|
||||
return new Command(this.service, this.method, this.withCallback, this.disposable, this.args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/Command.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/Command.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf7276ae3f7ff45f9b1f35d69ede7afa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/TapSDK/Core/Mobile/Runtime/Constants.cs
Normal file
9
Assets/TapSDK/Core/Mobile/Runtime/Constants.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string VersionKey = "Engine-Version";
|
||||
|
||||
public const string PlatformKey = "Engine-Platform";
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/Constants.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/Constants.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93d344834789c4be3973b920f2f3db9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/TapSDK/Core/Mobile/Runtime/EngineBridgeInitializer.cs
Normal file
34
Assets/TapSDK/Core/Mobile/Runtime/EngineBridgeInitializer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using TapSDK.Core.Internal;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
|
||||
namespace TapSDK.Core.Mobile
|
||||
{
|
||||
public static class EngineBridgeInitializer
|
||||
{
|
||||
private static bool isInitialized = false;
|
||||
private const string SERVICE_NAME = "BridgeCoreService";
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (!isInitialized)
|
||||
{
|
||||
TapLog.Log("Initializing EngineBridge");
|
||||
|
||||
// TODO: android 注册桥接
|
||||
// #if UNITY_ANDROID
|
||||
EngineBridge.GetInstance().Register(
|
||||
"com.taptap.sdk.core.unity.BridgeCoreService",
|
||||
"com.taptap.sdk.core.unity.BridgeCoreServiceImpl");
|
||||
// #endif
|
||||
|
||||
isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static Command.Builder GetBridgeServer()
|
||||
{
|
||||
return new Command.Builder().Service(SERVICE_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75ce492acd08b47a589d97f2eb9373ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/TapSDK/Core/Mobile/Runtime/IBridge.cs
Normal file
15
Assets/TapSDK/Core/Mobile/Runtime/IBridge.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public interface IBridge
|
||||
{
|
||||
void Register(string serviceClzName, string serviceImplName);
|
||||
|
||||
void Call(Command command);
|
||||
|
||||
void Call(Command command, Action<Result> action);
|
||||
string CallWithReturnValue(Command command, Action<Result> action);
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/IBridge.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/IBridge.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 756215630f6ce4667b60a1deaff8543a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
Assets/TapSDK/Core/Mobile/Runtime/IOSNativeWrapper.cs
Normal file
50
Assets/TapSDK/Core/Mobile/Runtime/IOSNativeWrapper.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using TapSDK.Core.Internal;
|
||||
using TapSDK.Core;
|
||||
|
||||
namespace TapSDK.Core.Mobile {
|
||||
public class IOSNativeWrapper
|
||||
{
|
||||
|
||||
#if UNITY_IOS
|
||||
// 导入 C 函数
|
||||
|
||||
// 定义一个委托类型,匹配 Objective-C 中的 block 参数
|
||||
public delegate string DynamicPropertiesCalculatorDelegate();
|
||||
|
||||
// 注意:这个方法的封装比较特殊,因为它需要一个返回 NSDictionary 的回调。
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _TapTapEventRegisterDynamicProperties(DynamicPropertiesCalculatorDelegate callback);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _TapTapSDKCoreSwitchToRND();
|
||||
|
||||
public static void SetRND(){
|
||||
_TapTapSDKCoreSwitchToRND();
|
||||
}
|
||||
// 定义一个 Func<string> 委托,用于从 Unity 使用者那里获取动态属性
|
||||
private static Func<string> dynamicPropertiesCallback;
|
||||
public static void RegisterDynamicProperties(Func<string> callback)
|
||||
{
|
||||
dynamicPropertiesCallback = callback;
|
||||
_TapTapEventRegisterDynamicProperties(DynamicPropertiesCalculator);
|
||||
}
|
||||
|
||||
// Unity 端的回调方法,返回一个 JSON 字符串
|
||||
[AOT.MonoPInvokeCallback(typeof(DynamicPropertiesCalculatorDelegate))]
|
||||
private static string DynamicPropertiesCalculator()
|
||||
{
|
||||
if (dynamicPropertiesCallback != null)
|
||||
{
|
||||
string properties = dynamicPropertiesCallback();
|
||||
return properties;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/IOSNativeWrapper.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/IOSNativeWrapper.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a625254200cf4a85a707809c2ad07e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
37
Assets/TapSDK/Core/Mobile/Runtime/Result.cs
Normal file
37
Assets/TapSDK/Core/Mobile/Runtime/Result.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
[Serializable]
|
||||
public class Result
|
||||
{
|
||||
public static int RESULT_SUCCESS = 0;
|
||||
|
||||
public static int RESULT_ERROR = -1;
|
||||
|
||||
[SerializeField] public int code;
|
||||
|
||||
[SerializeField] public string message;
|
||||
|
||||
[SerializeField] public string content;
|
||||
|
||||
[SerializeField] public string callbackId;
|
||||
|
||||
[SerializeField] public bool onceTime;
|
||||
|
||||
public Result()
|
||||
{
|
||||
}
|
||||
|
||||
public Result(string json)
|
||||
{
|
||||
JsonUtility.FromJsonOverwrite(json, this);
|
||||
}
|
||||
|
||||
public string ToJSON()
|
||||
{
|
||||
return JsonUtility.ToJson(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/Result.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/Result.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bed21977dc864ab3873055bfef79966
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
137
Assets/TapSDK/Core/Mobile/Runtime/TapCoreMobile.cs
Normal file
137
Assets/TapSDK/Core/Mobile/Runtime/TapCoreMobile.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using TapSDK.Core.Internal;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
using TapSDK.Core.Internal.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TapSDK.Core.Mobile
|
||||
{
|
||||
public class TapCoreMobile : ITapCorePlatform
|
||||
{
|
||||
private EngineBridge Bridge = EngineBridge.GetInstance();
|
||||
|
||||
public TapCoreMobile()
|
||||
{
|
||||
TapLog.Log("TapCoreMobile constructor");
|
||||
TapLoom.Initialize();
|
||||
EngineBridgeInitializer.Initialize();
|
||||
// 由于当通过 Application.Quit 退出时,iOS 端不会收到 applicationWillTerminate 的通知,
|
||||
// 所以不会调用 C++ 的 OnAppStop 方法,导致小概率会因 C++ 资源未正确释放触发崩溃,所以添加监听
|
||||
#if UNITY_IOS
|
||||
EventManager.AddListener(
|
||||
EventManager.OnApplicationQuit,
|
||||
(quit) =>
|
||||
{
|
||||
TapLog.Log("TapSDK Unity OnApplicationQuit");
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("handleEngineQuitEvent")
|
||||
.CommandBuilder()
|
||||
);
|
||||
}
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
|
||||
{
|
||||
TapLog.Log("TapCoreMobile SDK inited");
|
||||
SetPlatformAndVersion(TapTapSDK.SDKPlatform, TapTapSDK.Version);
|
||||
string coreOptionsJson = JsonUtility.ToJson(coreOption);
|
||||
string[] otherOptionsJson = otherOptions
|
||||
.Select(option => JsonConvert.SerializeObject(option))
|
||||
.ToArray();
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("init")
|
||||
.Args("coreOption", coreOptionsJson)
|
||||
.Args("otherOptions", otherOptionsJson)
|
||||
.CommandBuilder()
|
||||
);
|
||||
}
|
||||
|
||||
private void SetPlatformAndVersion(string platform, string version)
|
||||
{
|
||||
TapLog.Log(
|
||||
"TapCoreMobile SetPlatformAndVersion called with platform: "
|
||||
+ platform
|
||||
+ " and version: "
|
||||
+ version
|
||||
);
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("setPlatformAndVersion")
|
||||
.Args("platform", TapTapSDK.SDKPlatform)
|
||||
.Args("version", TapTapSDK.Version)
|
||||
.CommandBuilder()
|
||||
);
|
||||
SetSDKArtifact("Unity");
|
||||
}
|
||||
|
||||
private void SetSDKArtifact(string value)
|
||||
{
|
||||
TapLog.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("setSDKArtifact")
|
||||
.Args("artifact", "Unity")
|
||||
.CommandBuilder()
|
||||
);
|
||||
}
|
||||
|
||||
public void Init(TapTapSdkOptions coreOption)
|
||||
{
|
||||
Init(coreOption, new TapTapSdkBaseOptions[0]);
|
||||
}
|
||||
|
||||
public void UpdateLanguage(TapTapLanguageType language)
|
||||
{
|
||||
TapLog.Log("TapCoreMobile UpdateLanguage language: " + language);
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("updateLanguage")
|
||||
.Args("language", (int)language)
|
||||
.CommandBuilder()
|
||||
);
|
||||
}
|
||||
|
||||
public Task<bool> IsLaunchedFromTapTapPC()
|
||||
{
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
public void SendOpenLog(
|
||||
string project,
|
||||
string version,
|
||||
string action,
|
||||
Dictionary<string, string> properties
|
||||
)
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
string propertiesJson = JsonConvert.SerializeObject(properties);
|
||||
Bridge.CallHandler(
|
||||
EngineBridgeInitializer
|
||||
.GetBridgeServer()
|
||||
.Method("sendOpenLog")
|
||||
.Args("project", project)
|
||||
.Args("version", version)
|
||||
.Args("action", action)
|
||||
.Args("properties", propertiesJson)
|
||||
.CommandBuilder()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/TapCoreMobile.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/TapCoreMobile.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 058fcddd11e6f483c92c09963365f0ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
291
Assets/TapSDK/Core/Mobile/Runtime/TapEventMobile.cs
Normal file
291
Assets/TapSDK/Core/Mobile/Runtime/TapEventMobile.cs
Normal file
@@ -0,0 +1,291 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.InteropServices;
|
||||
using TapSDK.Core.Internal;
|
||||
using System.Collections.Generic;
|
||||
using TapSDK.Core.Internal.Log;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TapSDK.Core.Mobile
|
||||
{
|
||||
public class TapEventMobile : ITapEventPlatform
|
||||
{
|
||||
private EngineBridge Bridge = EngineBridge.GetInstance();
|
||||
|
||||
public TapEventMobile()
|
||||
{
|
||||
TapLog.Log("TapEventMobile constructor");
|
||||
EngineBridgeInitializer.Initialize();
|
||||
}
|
||||
|
||||
public void Init(TapTapEventOptions eventOptions)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetUserID(string userID)
|
||||
{
|
||||
TapLog.Log("TapEventMobile SetUserID = " + userID);
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("setUserID")
|
||||
.Args("userID", userID)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void SetUserID(string userID, string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile SetUserID" + userID + properties);
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("setUserID")
|
||||
.Args("userID", userID)
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void ClearUser()
|
||||
{
|
||||
TapLog.Log("TapEventMobile ClearUser");
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearUser")
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public string GetDeviceId()
|
||||
{
|
||||
string deviceId = Bridge.CallWithReturnValue(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("getDeviceId")
|
||||
.CommandBuilder());
|
||||
TapLog.Log("TapEventMobile GetDeviceId = " + deviceId);
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void LogEvent(string name, string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile LogEvent" + name + properties);
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("logEvent")
|
||||
.Args("name", name)
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void DeviceInitialize(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile DeviceInitialize" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceInitialize")
|
||||
.Args("deviceInitialize", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceInitialize")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void DeviceUpdate(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile DeviceUpdate" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceUpdate")
|
||||
.Args("deviceUpdate", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceUpdate")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void DeviceAdd(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile DeviceAdd" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceAdd")
|
||||
.Args("deviceAdd", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("deviceAdd")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void UserInitialize(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile UserInitialize" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userInitialize")
|
||||
.Args("userInitialize", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userInitialize")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void UserUpdate(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile UserUpdate" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userUpdate")
|
||||
.Args("userUpdate", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userUpdate")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void UserAdd(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile UserAdd" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userAdd")
|
||||
.Args("userAdd", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("userAdd")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void AddCommonProperty(string key, string value)
|
||||
{
|
||||
TapLog.Log("TapEventMobile AddCommonProperty" + key + value);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("addCommonProperty")
|
||||
.Args("addCommonProperty", key)
|
||||
.Args("value", value)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("addCommonProperty")
|
||||
.Args("key", key)
|
||||
.Args("value", value)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void AddCommon(string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile AddCommon" + properties);
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("addCommon")
|
||||
.Args("addCommon", properties)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("addCommonProperties")
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ClearCommonProperty(string key)
|
||||
{
|
||||
TapLog.Log("TapEventMobile ClearCommonProperty");
|
||||
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearCommonProperty")
|
||||
.Args("clearCommonProperty", key)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearCommonProperty")
|
||||
.Args("key", key)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ClearCommonProperties(string[] keys)
|
||||
{
|
||||
TapLog.Log("TapEventMobile ClearCommonProperties");
|
||||
|
||||
#if UNITY_IOS
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearCommonProperties")
|
||||
.Args("clearCommonProperties", keys)
|
||||
.CommandBuilder());
|
||||
#else
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearCommonProperties")
|
||||
.Args("keys", keys)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ClearAllCommonProperties()
|
||||
{
|
||||
TapLog.Log("TapEventMobile ClearAllCommonProperties");
|
||||
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("clearAllCommonProperties")
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties)
|
||||
{
|
||||
TapLog.Log("TapEventMobile LogChargeEvent" + orderID);
|
||||
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("logPurchasedEvent")
|
||||
.Args("orderID", orderID)
|
||||
.Args("productName", productName)
|
||||
.Args("amount", amount)
|
||||
.Args("currencyType", currencyType)
|
||||
.Args("paymentMethod", paymentMethod)
|
||||
.Args("properties", properties)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void RegisterDynamicProperties(Func<string> callback)
|
||||
{
|
||||
TapLog.Log("RegisterDynamicProperties called" + callback);
|
||||
#if UNITY_IOS
|
||||
IOSNativeWrapper.RegisterDynamicProperties(callback);
|
||||
#else
|
||||
AndroidNativeWrapper.RegisterDynamicProperties(callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetOAID(string value)
|
||||
{
|
||||
TapLog.Log("TapEventMobile SetOAID" + value);
|
||||
#if UNITY_ANDROID
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("setOAID")
|
||||
.Args("oaid", value)
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
|
||||
public void LogDeviceLoginEvent()
|
||||
{
|
||||
TapLog.Log("TapEventMobile LogDeviceLoginEvent");
|
||||
#if UNITY_ANDROID
|
||||
Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
|
||||
.Method("logDeviceLoginEvent")
|
||||
.CommandBuilder());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/TapEventMobile.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/TapEventMobile.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4afff3e4af4824f50b0b4a91897cc20a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "TapSDK.Core.Mobile.Runtime",
|
||||
"references": [
|
||||
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Android",
|
||||
"iOS"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10560023d8780423cb943c7a324b69f2
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/TapSDK/Core/Mobile/Runtime/TapUUID.cs
Normal file
9
Assets/TapSDK/Core/Mobile/Runtime/TapUUID.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace TapSDK.Core
|
||||
{
|
||||
public class TapUUID
|
||||
{
|
||||
public static string UUID(){
|
||||
return System.Guid.NewGuid().ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/TapSDK/Core/Mobile/Runtime/TapUUID.cs.meta
Normal file
11
Assets/TapSDK/Core/Mobile/Runtime/TapUUID.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e61d5874559a448db9aa22254d05fe7a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user