[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:
@@ -21,7 +21,7 @@ namespace tysdk
|
||||
|
||||
public static void UnityGetIdentityFun(string type){}
|
||||
|
||||
public static void UnityLoginOut(){}
|
||||
public static void UnityLogOutByChannel(EAccoutType accoutType){}
|
||||
//支付new
|
||||
public static void UnityKnowNew(string productId, string productPrice, string productName,
|
||||
string productCount, string prodorderId, string appInfo, string pType) { }
|
||||
@@ -46,15 +46,6 @@ namespace tysdk
|
||||
|
||||
public static int GetATT() {return 1;}
|
||||
|
||||
//广告相关
|
||||
public static void UnitySetAdBoxUserInfo(string userId){}
|
||||
|
||||
public static void UnityInitADSConfig(){}
|
||||
|
||||
public static void UnityLoadRvADS(){}
|
||||
|
||||
public static void UnityShowRVAD() { }
|
||||
|
||||
#elif UNITY_ANDROID
|
||||
|
||||
private static string SDK_CLASS = "com.unity3d.player.SDKManager";
|
||||
@@ -106,23 +97,9 @@ namespace tysdk
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnityLoginOut()
|
||||
public static void UnityLogOutByChannel(EAccoutType accoutType)
|
||||
{
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
sdkManager.CallStatic("UnityLoginOut");
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnityLogOutByChannel()
|
||||
{
|
||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||
{
|
||||
if(PlayerPrefs.HasKey("last_login_channel"))
|
||||
{
|
||||
sdkManager.CallStatic("UnityLogOutByChannel", PlayerPrefs.GetString("last_login_channel"));
|
||||
}
|
||||
}
|
||||
sdkManager.CallStatic("UnityLogOutByChannel", accoutType.ToString());
|
||||
}
|
||||
|
||||
//支付new
|
||||
@@ -187,15 +164,6 @@ namespace tysdk
|
||||
|
||||
public static int GetATT() {return 1;}
|
||||
|
||||
//广告相关
|
||||
public static void UnitySetAdBoxUserInfo(string userId){}
|
||||
|
||||
public static void UnityInitADSConfig(){}
|
||||
|
||||
public static void UnityLoadRvADS(){}
|
||||
|
||||
public static void UnityShowRVAD(){}
|
||||
|
||||
|
||||
#elif UNITY_IOS
|
||||
|
||||
@@ -238,6 +206,31 @@ namespace tysdk
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityLoginOut();
|
||||
|
||||
public static void UnityLogOutByChannel(EAccoutType accoutType)
|
||||
{
|
||||
switch (accoutType)
|
||||
{
|
||||
case EAccoutType.hwGoogle:
|
||||
UnityLogoutGoogle();
|
||||
break;
|
||||
case EAccoutType.hwFacebook:
|
||||
UnityLogoutFacebook();
|
||||
break;
|
||||
case EAccoutType.hwGuest:
|
||||
UnityLogoutGuest();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UnityLogoutGoogle();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UnityLogoutFacebook();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void UnityLogoutGuest();
|
||||
|
||||
//支付
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityKnow(string userId, string productId, string productPrice, string productName,
|
||||
@@ -257,19 +250,6 @@ namespace tysdk
|
||||
[DllImport("__Internal")]
|
||||
public static extern void GAReportParams(int type, string eventstr, string paramstr);
|
||||
|
||||
//广告相关
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnitySetAdBoxUserInfo(string userId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityInitADSConfig();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityLoadRvADS();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void UnityShowRVAD();
|
||||
|
||||
//ATT
|
||||
[DllImport("__Internal")]
|
||||
public static extern void RequestATT();
|
||||
@@ -277,24 +257,5 @@ namespace tysdk
|
||||
[DllImport("__Internal")]
|
||||
public static extern int GetATT();
|
||||
#endif
|
||||
|
||||
public static string GetLoginTypeName(EAccoutType accoutType)
|
||||
{
|
||||
string str = String.Empty;
|
||||
switch (accoutType)
|
||||
{
|
||||
case EAccoutType.hwGoogle:
|
||||
str = EAccoutTypeName.hwGoogle;
|
||||
break;
|
||||
case EAccoutType.hwFacebook:
|
||||
str = EAccoutTypeName.hwFacebook;
|
||||
break;
|
||||
case EAccoutType.hwGuest:
|
||||
str = EAccoutTypeName.hwGuest;
|
||||
break;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user