[M] all functional

This commit is contained in:
2024-08-16 00:56:24 +08:00
parent c355784122
commit 1a0af9d725
14 changed files with 1278 additions and 171 deletions

View File

@@ -19,6 +19,14 @@ public class SDKTest : MonoBehaviour
[SerializeField]
private Button _loginTokenBtn;
[SerializeField]
private Button _linkGoogleBtn;
[SerializeField]
private Button _checkGoogleBtn;
[SerializeField]
private Button _linkFacbookBtn;
[SerializeField]
private Button _checkFacbookBtn;
[SerializeField]
private Button _logOutBtn;
[SerializeField]
private Button _payTestBtn;
@@ -47,6 +55,10 @@ public class SDKTest : MonoBehaviour
_loginFbBtn.onClick.AddListener(() => OnLogin(EAccoutType.hwFacebook));
_loginTokenBtn.onClick.AddListener(OnLoginByToken);
_logOutBtn.onClick.AddListener(OnLogout);
_linkGoogleBtn.onClick.AddListener(OnLinkGoogle);
_checkGoogleBtn.onClick.AddListener(OncheckGoogle);
_linkFacbookBtn.onClick.AddListener(OnLinkFacebook);
_checkFacbookBtn.onClick.AddListener(OncheckFacebook);
_payTestBtn.onClick.AddListener(OnPayTestBtn);
_payListBtn.onClick.AddListener(OnPayListBtn);
_gaTestBtn.onClick.AddListener(OnGaBtn);
@@ -101,7 +113,7 @@ public class SDKTest : MonoBehaviour
if (info.isSuccess)
{
_messageTxt.text += $"\n{info.msg}";
_messageTxt.text += $"\n{TYSdkFacade.Instance.TYAccountInfo.token}";
_messageTxt.text += $"\n{TYSdkFacade.TYAccountInfo.token}";
}
}
@@ -114,7 +126,7 @@ public class SDKTest : MonoBehaviour
if (info.isSuccess)
{
_messageTxt.text += $"\n{info.msg}";
_messageTxt.text += $"\n{TYSdkFacade.Instance.TYAccountInfo.token}";
_messageTxt.text += $"\n{TYSdkFacade.TYAccountInfo.token}";
}
}
@@ -130,24 +142,7 @@ public class SDKTest : MonoBehaviour
_messageTxt.text = "no product";
return;
}
string prodId = sku.productId;
string pType = string.Empty;
#if UNITY_ANDROID
pType = sku.type;
#endif
string prodPrice = sku.price;
#if UNITY_EDITOR
string prodName = string.Empty;
#elif UNITY_ANDROID
string prodName = sku.title;
#elif UNITY_IOS
string prodName = sku.localizedTitle;
#endif
int count = 1;
Debug.LogError($"[AggSdk::Pay] prodId : {prodId} prodPrice : {prodPrice} prodName : {prodName} ");
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(prodId, prodPrice, prodName, count, pType);
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1);
_messageTxt.text = "\n" + $"Success : {payResult.isSuccess}";
_messageTxt.text += "\n" + $"message : {payResult.msg}";
}
@@ -265,6 +260,35 @@ public class SDKTest : MonoBehaviour
Debug.Log(msg);
}
private async void OnLinkGoogle()
{
_messageTxt.text = string.Empty;
var isSuccess = await TYSdkFacade.Instance.LinkAccount(EAccoutType.hwGoogle);
_messageTxt.text = $"\n link google account : {isSuccess}";
}
private async void OnLinkFacebook()
{
_messageTxt.text = string.Empty;
var isSuccess = await TYSdkFacade.Instance.LinkAccount(EAccoutType.hwFacebook);
_messageTxt.text = $"\n link facebook account : {isSuccess}";
}
private async void OncheckGoogle()
{
_messageTxt.text = string.Empty;
var isSuccess = await TYSdkFacade.Instance.LinkCheck(EAccoutType.hwGoogle);
_messageTxt.text = $"\n google account linked : {isSuccess}";
}
private async void OncheckFacebook()
{
_messageTxt.text = string.Empty;
var isSuccess = await TYSdkFacade.Instance.LinkCheck(EAccoutType.hwFacebook);
_messageTxt.text = $"\n facebook account linked : {isSuccess}";
}
/*
public void OnTaBtn()
{