[F] Link [A] signout
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user