2024-06-20 10:30:22 +00:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2024-04-17 11:57:11 +00:00
|
|
|
namespace Guru
|
|
|
|
|
{
|
|
|
|
|
public partial class GuruSDK
|
|
|
|
|
{
|
|
|
|
|
#region System
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 打开页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="url"></param>
|
|
|
|
|
public static void OpenURL(string url)
|
|
|
|
|
{
|
|
|
|
|
GuruWebview.OpenPage(url);
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-23 06:09:35 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// 打开隐私协议页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void OpenPrivacyPage()
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(PrivacyUrl))
|
|
|
|
|
{
|
|
|
|
|
LogE("PrivacyUrl is null");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpenURL(PrivacyUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 打开服务条款页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void OpenTermsPage()
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(TermsUrl))
|
|
|
|
|
{
|
|
|
|
|
LogE("TermsUrl is null");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
OpenURL(TermsUrl);
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-17 11:57:11 +00:00
|
|
|
#endregion
|
2024-07-26 03:08:31 +00:00
|
|
|
|
2024-06-20 10:30:22 +00:00
|
|
|
#region Android System
|
|
|
|
|
|
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取 AndroidSDK 的系统版本号
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static int GetAndroidSystemVersion()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// sdkInt 是 Android SDK 的整数版本号,例如 Android 10 对应 29。
|
|
|
|
|
// release 是 Android 版本的字符串表示,例如 "10"。
|
|
|
|
|
using (AndroidJavaClass jc = new AndroidJavaClass("android.os.Build$VERSION"))
|
|
|
|
|
{
|
|
|
|
|
int sdkInt = jc.GetStatic<int>("SDK_INT");
|
|
|
|
|
Debug.LogWarning($"[SDK] --- Android SDK Version:{sdkInt}");
|
|
|
|
|
return sdkInt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError(ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-04-17 11:57:11 +00:00
|
|
|
}
|
|
|
|
|
}
|