[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

@@ -0,0 +1,15 @@
// iOSReview.m
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
extern "C" {
void RequestReview(const char* customReviewURL) {
if (@available(iOS 10.3, *)) {
[SKStoreReviewController requestReview];
} else {
NSString *url = [NSString stringWithUTF8String:customReviewURL];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
}
}

View File

@@ -0,0 +1,37 @@
fileFormatVersion: 2
guid: b9382ac867441064e988d90a52bad1ca
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings: {}
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

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()
{
}
}