unity3D接入Sign in with Apple
前言,觉得好的同学别忘了给个好评哦,另外,如果有什么疑问的,欢迎随时提问~~
苹果明确规定2020.6.30之后提交到AppStroe审核的app如接入了第三方登录,则必须接入Sign in with Apple;下面给大家分享一下unity3D接入Sign in with Apple的具体流程:
1、首先是按钮格式必须使用苹果给定的几种,具体可以参考链接 苹果官方登录按钮样式;
2、oc代码:
#import <Foundation/Foundation.h>
#import <AuthenticationServices/AuthenticationServices.h>
#import "UnityAppController.h"
struct UserInfo
{
const char * userId;
const char * email;
const char * displayName;
const char * idToken;
const char * error;
ASUserDetectionStatus userDetectionStatus;
};
typedef void (*SignInWithAppleCallback)(int result, struct UserInfo s1);
API_AVAILABLE(ios(13.0), tvos(13.0))
typedef void (*CredentialStateCallback)(ASAuthorizationAppleIDProviderCredentialState state);
API_AVAILABLE(ios(13.0), tvos(13.0))
@interface UnitySignInWithApple : NSObject<ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding>
@property (nonatomic) SignInWithAppleCallback loginCallback;
@property (nonatomic) CredentialStateCallback credentialStateCallback;
@end
API_AVAILABLE(ios(13.0), tvos(13.0))
static UnitySignInWithApple* _unitySignInWithAppleInstance;
@implementation UnitySignInWithApple
{
ASAuthorizationAppleIDRequest* request;
}
+(UnitySignInWithApple*)instance
{
if (_unitySignInWithAppleInstance == nil)
_unitySignInWithAppleInstance = [[UnitySignInWithApp

本文详细介绍了如何在Unity3D项目中集成Sign in with Apple功能,包括遵循苹果官方按钮样式要求、OC代码实现、C#代码接口提供及Lua调用示例,为开发者提供了全面的指导。
9142

被折叠的 条评论
为什么被折叠?



