123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- using UnityEngine;
- #if UNITY_IOS
- public class PottingMobileUtilsiOS : PottingMobileUtilsBase
- {
- [DllImport("__Internal")]
- private static extern string GetCurrentNetworkState();
- /// 获取设备IDFA
- [DllImport("__Internal")]
- private static extern string GetDeviceIDFA();
- /// 获取设备IDFV
- [DllImport("__Internal")]
- private static extern string GetDeviceIDFV();
- [DllImport("__Internal")]
- /// 是否是异形屏
- private static extern bool IsAbnormityScreen();
- [DllImport("__Internal")]
- /// 获取设备系统版本
- private static extern string GetDeviceSystomVersion();
- //获取网络商名称
- [DllImport("__Internal")]
- private static extern string GetCarrierName();
- [DllImport("__Internal")]
- private static extern string GetDeviceVersion();
- [DllImport("__Internal")]
- private static extern string GetDeviceInfo();
- /// <summary>
- /// 获取网络状态
- /// </summary>
- public new static string _GetNetworkType()
- {
- return GetCurrentNetworkState();
- }
- /// <summary>
- /// 获取设备id
- /// </summary>
- /// <returns></returns>
- public new static string _GetDeviceId()
- {
- return GetDeviceIDFA();
- }
- /// <summary>
- /// 获取iOS设备的IDFV,同一发布厂商在同设备下相同,卸载只不会改变
- /// </summary>
- /// <returns></returns>
- public new static string _iosGetDeviceIDFV()
- {
- return GetDeviceIDFA();
- }
- /// <summary>
- /// 判断是否挖孔屏
- /// </summary>
- /// <returns></returns>
- public new static bool _HasNotchScreen()
- {
- return IsAbnormityScreen();
- }
- /// <summary>
- /// 获取系统版本
- /// </summary>
- /// <returns></returns>
- public new static string _GetSystemVersion()
- {
- return GetDeviceSystomVersion();
- }
- public new static string _GetSimOperatorByMnc()
- {
- return GetCarrierName();
- }
- /// <summary>
- /// 获取手机型号
- /// </summary>
- /// <returns></returns>
- public new static string _GetModel()
- {
- return GetDeviceVersion();
- }
- /// <summary>
- /// 获取手机信息字典
- /// </summary>
- /// <returns></returns>
- public new static string _GetDeviceInfo()
- {
- return GetDeviceInfo();
- }
-
- }
- #endif
|