[M] login & logout & payment
- login by token - save account info - logout remove accout info - iOS SKU list parser - iOS Pay
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace tysdk
|
||||
{
|
||||
@@ -11,12 +12,6 @@ namespace tysdk
|
||||
none
|
||||
}
|
||||
|
||||
public class EAccoutTypeName
|
||||
{
|
||||
public static string hwGoogle = "hwGoogle";
|
||||
public static string hwFacebook = "hwFacebook";
|
||||
public static string hwGuest = "hwGuest";
|
||||
}
|
||||
public interface ITYSdkCallback { }
|
||||
|
||||
public class LoginInfo : ITYSdkCallback
|
||||
@@ -50,8 +45,27 @@ namespace tysdk
|
||||
public int code = 1;
|
||||
public string msg = string.Empty;
|
||||
public List<SKUDetail> products;
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
public void ReadSKUFromJson(string json)
|
||||
{
|
||||
var prodList = Newtonsoft.Json.Linq.JArray.Parse(json).Select(x => {
|
||||
return new SKUDetail() {
|
||||
price = x["price"].ToString(),
|
||||
productId = x["productId"].ToString(),
|
||||
LocaleCurrencyCode = x["LocaleCurrencyCode"].ToString(),
|
||||
localeCurrencySymbol = x["localeCurrencySymbol"].ToString(),
|
||||
localizedDescription = x["localizedDescription"].ToString(),
|
||||
localizedTitle = x["localizedTitle"].ToString()
|
||||
};
|
||||
}).ToList();
|
||||
products = prodList;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID || UNITY_EDITOR
|
||||
public class SKUDetail
|
||||
{
|
||||
public string description;
|
||||
@@ -62,7 +76,29 @@ namespace tysdk
|
||||
public string productId;
|
||||
public string title;
|
||||
public string type;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
#elif UNITY_IOS
|
||||
public class SKUDetail
|
||||
{
|
||||
public string price;
|
||||
public string productId;
|
||||
public string LocaleCurrencyCode;
|
||||
public string localeCurrencySymbol;
|
||||
public string localizedDescription;
|
||||
public string localizedTitle;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
public class ATTInfo : ITYSdkCallback
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user