unity3D接入Sign in with Apple

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

开发板推荐:天空星STM32F407VET6开发板

超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

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

开发板推荐:天空星STM32F407VET6开发板

超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值