update: 添加 AppVersion 版本获取的功能

deeplink
胡宇飞 2024-03-12 10:35:00 +08:00
parent d17a6e2eae
commit 3871841988
3 changed files with 56 additions and 25 deletions

View File

@ -0,0 +1,52 @@
namespace Guru
{
public partial class GuruSDK
{
public static string UID => _model?.UserId ?? IPMConfig.IPM_UID;
public static string DeviceId => IPMConfig.IPM_DEVICE_ID ?? ""; // TODO: change it to _model member later.
public static string PushToken => IPMConfig.IPM_PUSH_TOKEN ?? ""; // TODO: change it to _model member later.
public static string SupportEmail => GuruSettings.SupportEmail ?? "";
public static string StoreUrl
{
get
{
string url = "";
#if UNITY_EDITOR
url = "https://test@com.guru.ai";
#elif UNITY_ANDROID
url = GuruSettings?.AndroidStoreUrl ?? "";
#elif UNITY_IOS
url = GuruSettings?.IOSStoreUrl ?? "";
#endif
return url;
}
}
public static string AppVersion =>GuruAppVersion.version;
public static string AppVersionCode => GuruAppVersion.code;
public static string AppVersionString => GuruAppVersion.ToString();
private static GuruAppVersion _appVersion;
private static GuruAppVersion GuruAppVersion
{
get
{
if(_appVersion == null) _appVersion = GuruAppVersion.Load();
return _appVersion;
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ab7d65b5c8774a12924f3fe72a6e4a38
timeCreated: 1710154459

View File

@ -8,7 +8,7 @@ namespace Guru
public partial class GuruSDK: MonoBehaviour
{
public const string Version = "1.0.7";
public const string Version = "1.0.9";
public const string Tag = "[Guru]";
public const string ServicesConfigKey = "guru_services";
@ -402,30 +402,6 @@ namespace Guru
{
SetUserBPlay(bplay);
}
public static string UID => _model?.UserId ?? IPMConfig.IPM_UID;
public static string DeviceId => IPMConfig.IPM_DEVICE_ID ?? ""; // TODO: change it to _model member later.
public static string PushToken => IPMConfig.IPM_PUSH_TOKEN ?? ""; // TODO: change it to _model member later.
public static string SupportEmail => GuruSettings.SupportEmail ?? "";
public static string StoreUrl
{
get
{
string url = "";
#if UNITY_EDITOR
url = "https://test@com.guru.ai";
#elif UNITY_ANDROID
url = GuruSettings?.AndroidStoreUrl ?? "";
#elif UNITY_IOS
url = GuruSettings?.IOSStoreUrl ?? "";
#endif
return url;
}
}
#endregion