隐私清单与 iOS URL Handlers
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
面向 App 开发者的隐私清单
标题为“面向 App 开发者的隐私清单”的章节如果您使用 Google、Facebook 或 Apple 登录,请声明这些 SDK 收集的数据,写在 App 的 PrivacyInfo.xcprivacy 文件中。将该文件添加到 App 的以下路径: ios/App/PrivacyInfo.xcprivacy.
不要将此文件添加到插件包中。请根据你应用的实际用法和 SDK 提供商的文档调整数据类型。
Google Sign-In 示例
标题为“Google Sign-In 示例”的章节{ "NSPrivacyCollectedDataTypes": [ { "NSPrivacyCollectedDataType": "EmailAddress", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "Name", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "UserID", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false } ]}Facebook Login 示例
标题为“Facebook Login 示例”的章节{ "NSPrivacyCollectedDataTypes": [ { "NSPrivacyCollectedDataType": "EmailAddress", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "Name", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "UserID", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "FriendsList", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false } ]}Apple Sign-In 示例
标题为“Apple Sign-In 示例”的章节{ "NSPrivacyCollectedDataTypes": [ { "NSPrivacyCollectedDataType": "EmailAddress", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "Name", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false } ]}查看 Apple 隐私清单文档 适用于所有允许的键值对。
合并 Facebook 和 Google URL handlers
标题为“合并 Facebook 和 Google URL handlers”的部分当 iOS 应用同时使用 Facebook 和 Google 登录时,在将回调 URL 传回 Capacitor 之前,需先将其路由至这两个 SDK。
在 ios/App/App/AppDelegate.swift:
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { // Return true if the URL was handled by either Facebook or Google authentication. if FBSDKCoreKit.ApplicationDelegate.shared.application( app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation] ) || GIDSignIn.sharedInstance.handle(url) { return true }
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)}请确保 AppDelegate.swift 导入应用所使用的 SDK:
import Capacitorimport FBSDKCoreKitimport GoogleSignInimport UIKit