update:更新SDK 修改
This commit is contained in:
@@ -322,6 +322,9 @@ namespace tysdk
|
||||
result.isSuccess = true;
|
||||
result.userId = _accountInfo.userId;
|
||||
SetUserInfo();
|
||||
#if UNITY_ANDROID
|
||||
UnityBridgeFunc.RefreshBillingService();
|
||||
#endif
|
||||
}
|
||||
|
||||
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
|
||||
@@ -414,6 +417,9 @@ namespace tysdk
|
||||
{
|
||||
_accountInfo.AddLinkedAccount(accoutType);
|
||||
_accountInfo.Save();
|
||||
#if UNITY_ANDROID
|
||||
UnityBridgeFunc.RefreshBillingService();
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -160,10 +160,18 @@ namespace tysdk
|
||||
var result = new ProductListInfo();
|
||||
return result;
|
||||
#elif UNITY_ANDROID || UNITY_IOS
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<ProductListInfo>();
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<ProductListInfo>(TimeSpan.FromSeconds(45));
|
||||
UnityBridgeFunc.GetSKUList();
|
||||
var result = await task;
|
||||
return result;
|
||||
try
|
||||
{
|
||||
var result = await task;
|
||||
return result;
|
||||
}
|
||||
catch (TaskCanceledException e)
|
||||
{
|
||||
Debug.LogWarning($"[TYSdkFacade] GetSKUList timeout: {e.Message}");
|
||||
return new ProductListInfo() { code = 1, msg = "sku_callback_timeout" };
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -176,10 +184,18 @@ namespace tysdk
|
||||
await Task.Yield();
|
||||
return new ProductListInfo();
|
||||
#elif UNITY_ANDROID
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<ProductListInfo>();
|
||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<ProductListInfo>(TimeSpan.FromSeconds(45));
|
||||
UnityBridgeFunc.GetSKUListByIapIds(productIds);
|
||||
var result = await task;
|
||||
return result;
|
||||
try
|
||||
{
|
||||
var result = await task;
|
||||
return result;
|
||||
}
|
||||
catch (TaskCanceledException e)
|
||||
{
|
||||
Debug.LogWarning($"[TYSdkFacade] GetSKUListByIapIds timeout: {e.Message}");
|
||||
return new ProductListInfo() { code = 1, msg = "sku_callback_timeout" };
|
||||
}
|
||||
#else
|
||||
return new ProductListInfo() { code = -1, msg = "unsupported platform" };
|
||||
#endif
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace tysdk
|
||||
|
||||
public static string GetPendingPurchases() => "[]";
|
||||
|
||||
public static void RefreshBillingService() { }
|
||||
|
||||
//打点
|
||||
public static void SetGaUserInfo(string userId){}
|
||||
public static void SetGaCommonInfo(string SetGaCommonInfo){}
|
||||
@@ -224,6 +226,15 @@ namespace tysdk
|
||||
}
|
||||
}
|
||||
|
||||
public static void RefreshBillingService()
|
||||
{
|
||||
UnityEngine.Debug.Log("UnityBridgeFunc.RefreshBillingService");
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
sdkManager.CallStatic("RefreshBillingService");
|
||||
}
|
||||
}
|
||||
|
||||
public static void CancelBillingFlow()
|
||||
{
|
||||
UnityEngine.Debug.Log("UnityBridgeFunc.CancelBillingFlow");
|
||||
@@ -470,6 +481,8 @@ namespace tysdk
|
||||
|
||||
public static string GetPendingPurchases() => "[]";
|
||||
|
||||
public static void RefreshBillingService() { }
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user