parent
3c22bea3f7
commit
2dd94403ea
|
|
@ -7,7 +7,7 @@ namespace Guru
|
|||
/// UUID (V4)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string UUID => System.Guid.NewGuid().ToString();
|
||||
public static string UUID => System.Guid.NewGuid().ToString("D");
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Guru
|
|||
private const string DefaultCategory = "Store";
|
||||
|
||||
private static bool _showLog;
|
||||
private static string _userId;
|
||||
private static string _uuid;
|
||||
|
||||
private ConfigurationBuilder _configBuilder; // 商店配置创建器
|
||||
|
||||
|
|
@ -133,9 +133,9 @@ namespace Guru
|
|||
/// <summary>
|
||||
/// 初始化支付服务
|
||||
/// </summary>
|
||||
public virtual void Initialize(string userId, bool showLog = false)
|
||||
public virtual void Initialize(string uuid, bool showLog = false)
|
||||
{
|
||||
_userId = userId;
|
||||
_uuid = uuid;
|
||||
_showLog = showLog;
|
||||
InitPurchasing();
|
||||
}
|
||||
|
|
@ -143,16 +143,16 @@ namespace Guru
|
|||
/// <summary>
|
||||
/// 带有校验器的初始化
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="googlePublicKey"></param>
|
||||
/// <param name="appleRootCert"></param>
|
||||
/// <param name="showLog"></param>
|
||||
public virtual void InitWithKeys(string userId, byte[] googlePublicKey, byte[] appleRootCert, bool showLog = false)
|
||||
public virtual void InitWithKeys(string uuid, byte[] googlePublicKey, byte[] appleRootCert, bool showLog = false)
|
||||
{
|
||||
_googlePublicKey = googlePublicKey;
|
||||
_appleRootCert = appleRootCert;
|
||||
InitModel();
|
||||
Initialize(userId, showLog);
|
||||
Initialize(uuid, showLog);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -229,9 +229,9 @@ namespace Guru
|
|||
{
|
||||
_storeController = controller;
|
||||
_storeExtensionProvider = extensions;
|
||||
if (string.IsNullOrEmpty(_userId)) _userId = IPMConfig.IPM_UID;
|
||||
if (string.IsNullOrEmpty(_uuid)) _uuid = IPMConfig.IPM_DEVICE_ID;
|
||||
|
||||
LogI($"--- IAP Initialized Success. With UID: {_userId}");
|
||||
LogI($"--- IAP Initialized Success. With UID: {_uuid}");
|
||||
|
||||
#if UNITY_IOS
|
||||
_appleExtensions = extensions.GetExtension<IAppleExtensions>();
|
||||
|
|
@ -244,7 +244,7 @@ namespace Guru
|
|||
OnAppStorePurchaseDeferred?.Invoke(item);
|
||||
});
|
||||
#elif UNITY_ANDROID
|
||||
_configBuilder.Configure<IGooglePlayConfiguration>().SetObfuscatedAccountId(_userId); // SetUp UID
|
||||
_configBuilder.Configure<IGooglePlayConfiguration>().SetObfuscatedAccountId(_uuid); // SetUp UID
|
||||
_googlePlayStoreExtensions = extensions.GetExtension<IGooglePlayStoreExtensions>();
|
||||
// _googlePlayStoreExtensions.SetObfuscatedAccountId(IPMConfig.IPM_UID);
|
||||
//添加安装游戏后第一次初试化进行恢复购买的回调 只有安卓才有
|
||||
|
|
|
|||
Loading…
Reference in New Issue