Commit 6ec1837a authored by 张广义's avatar 张广义

删除iOSHander

parent a9b9ed11
......@@ -26,7 +26,7 @@ public class AppConfig
{
// 初始化iOS交互
#if !UNITY_EDITOR && UNITY_IOS
iOSHander.Instance.Handler();
UnityPhoneUtils.Instance.Handler();
#endif
Constant.Instance.IsTestNet = isTest;
......
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using AOT;
......@@ -39,6 +40,33 @@ public class UnityPhoneUtils
return phoneUtil;
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ResultHandler(string device, string IDFA);
[MonoPInvokeCallback(typeof(ResultHandler))]
static void resultHandler(string deviceStr, string IDFAStr)
{
Debug.Log("resultHandler : deviceStr = " + deviceStr + "IDFAStr = " + IDFAStr);
Constant.Instance.device = deviceStr;
Constant.Instance.idfa = IDFAStr;
}
[DllImport("__Internal")]
static extern void BridageDeviceAndIDFA(IntPtr resultHandler);
public void Handler()
{
ResultHandler handler = new ResultHandler(resultHandler);
IntPtr fp = Marshal.GetFunctionPointerForDelegate(handler);
BridageDeviceAndIDFA(fp);
}
public string GetImsi()
{
string imsi = "";
......
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using AOT;
using UnityEngine;
public class iOSHander
{
private iOSHander() { }
private static readonly iOSHander singleInstance = new iOSHander();
public static iOSHander Instance
{
get
{
return singleInstance;
}
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ResultHandler(string device, string IDFA);
[MonoPInvokeCallback(typeof(ResultHandler))]
static void resultHandler(string deviceStr, string IDFAStr)
{
Debug.Log("resultHandler : deviceStr = " + deviceStr + "IDFAStr = " + IDFAStr);
Constant.Instance.device = deviceStr;
Constant.Instance.idfa = IDFAStr;
}
[DllImport("__Internal")]
static extern void BridageDeviceAndIDFA(IntPtr resultHandler);
public void Handler()
{
ResultHandler handler = new ResultHandler(resultHandler);
IntPtr fp = Marshal.GetFunctionPointerForDelegate(handler);
BridageDeviceAndIDFA(fp);
}
}
fileFormatVersion: 2
guid: 3046b42bbeae947ffb400d0fc7a48d24
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment