[F] Link [A] signout

This commit is contained in:
2024-08-24 19:23:39 +08:00
parent da367097c8
commit 728af3cfd7
11 changed files with 928 additions and 3 deletions

View File

@@ -98,6 +98,15 @@ extern "C" {
}];
}
void UnityLoginByApple()
{
XYLoginReq *req = [XYLoginReq initWithLoginType:XYLoginWithApple];
[XYApi XYLoginWith:req completionHandler:^(XYResp * _Nonnull resp) {
NSLog(@"TYSdkInterface UnityLoginByApple: %@", resp);
ProcessLoginResult(resp);
}];
}
void UnityGetIdentityFun(const char* type)
{
@@ -138,6 +147,12 @@ extern "C" {
[XYApi XYLogoutChannelWithType:XYLoginWithGuest];
}
void UnityLogoutApple()
{
NSLog(@"TYSdkInterface UnityLogoutApple");
[XYApi XYLogoutChannelWithType:XYLoginWithApple];
}
//支付
void UnityKnow(const char* userId,const char* productId,const char* productPrice,const char* productName,const char* productCount,const char* orderid,const char* appinfo)
{
@@ -294,4 +309,46 @@ extern "C" {
{
}
void LinkApple()
{
NSLog(@"TYSdkInterface LinkApple");
NSDictionary * userDic = [XYApi XYGetCurrentUserDict];
XYBindReq *bindReq = [XYBindReq initBindWithPlatform:XYBindApple UserId: [ [userDic objectForKey:@"userId"] unsignedIntegerValue]];
[XYApi XYBindByBindReq:bindReq isUnbindGuest:@"false" completionHandler:^(XYResp * _Nonnull resp) {
if(resp.errCode == XYSuccess)
{
NSLog(@"TYSdkInterface LinkApple Success");
UnitySendMessage("TYSdkFacade","LinkAccoutResult", "1");
}
else
{
NSLog(@"TYSdkInterface LinkApple Faild");
UnityLogoutFacebook();
UnitySendMessage("TYSdkFacade","LinkAccoutResult", "0");
}
}];
}
void IsLinkedApple()
{
[XYApi CheckUserExist:XYBindApple completion:^(XYResp * _Nonnull resp) {
if (resp.errCode == XYSNSExist) {
UnitySendMessage("TYSdkFacade","CheckLinkResult", "1");
}else if (resp.errCode == XYSNSNotExist){
UnitySendMessage("TYSdkFacade","CheckLinkResult", "0");
} else {
UnitySendMessage("TYSdkFacade","CheckLinkResult", "-1");
}
}];
}
void UnlinkApple()
{
}
}