Apple登录接入记录

发布于:2025-08-31 ⋅ 阅读:(34) ⋅ 点赞:(0)

本文由 NRatel 历史笔记整理而来,如有错误欢迎指正。

Apple文档——通过 Apple 登录

使用入门 - 通过 Apple 登录 - Apple Developer

Apple文档——设计要求——登录通过 Apple 登录 | Apple Developer Documentation

插件github版——apple-signin-unity(README 中为接入步骤)

GitHub - lupidan/apple-signin-unity: Unity plugin to support Sign In With Apple Id

Unity Blog——Support for Apple sign in(注意其中assetstore链接已失效)

https://blog.unity.com/engine-platform/support-for-apple-sign-in

或使用Unity AssetStore 版——Sign in with Apple Plugin for Unity

Sign in with Apple Plugin for Unity | Integration | Unity Asset Store

Apple文档开发者账户帮助(后台管理)(管理账号/团队/证书/密钥、配置服务/功能等)

账户 - 帮助 - Apple Developer

按照 github ReadMe 接入:

1、按Unity Package Manager 的导入方式。导入 v1.4.3版。

2、完成插件设置(ios)(使用脚本进行设置)

在Unity Assets/Editor/AppleAuth 中创建 SignInWithApplePostprocessor.cs

(注意全部包入 #if UNITY_IOS 中)

3、初始化

4、按照流程图写登录逻辑。

流程大意:

⑴、有历史UserId时,先 GetCredentialState 判断状态,若已登录则完整;若未登录则 DoLoginWithAppleId 

⑵、无历史UserId时,先DoQuickLogin若失败则 DoLoginWithAppleId

⑶、若 DoLoginWithAppleId 失败,将提示错误,并返回至“选择登录方式”状态。

打包报错:

/Users/nratel/.jenkins/workspace/BuildTestApp_iOS/NativeProject/XXX/Unity-iPhone.xcodeproj: error: Provisioning profile "DevXXX20240606" doesn't support the Sign in with Apple capability. (in target 'Unity-iPhone' from project 'Unity-iPhone')

/Users/nratel/.jenkins/workspace/BuildTestApp_iOS/NativeProject/XXX/Unity-iPhone.xcodeproj: error: Provisioning profile "DevXXX20240606" doesn't include the com.apple.developer.applesignin entitlement. Profile qualification is using entitlement definitions that may be out of date. Connect to network to update. (in target 'Unity-iPhone' from project 'Unity-iPhone')

原因:证书不支持。

解决:找运营更换证书。


网站公告

今日签到

点亮在社区的每一天
去签到