隐私清单和 iOS URL 处理器
复制一个包含安装步骤和本插件的完整 Markdown 指南的配置提示。
应用开发者隐私清单
标题:应用开发者隐私清单如果您使用 Google、Facebook 或 Apple 登录,必须在应用的 PrivacyInfo.xcprivacy 文件中声明这些 SDK 收集的数据。将文件添加到您的应用中 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 登录示例
标题:Facebook 登录示例{ "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和GoogleURL处理程序
当iOS应用程序使用Facebook和Google登录时,路由回调URL到两个SDK,然后将其传回__CAPGO_KEEP_0__。When an iOS app uses both Facebook and Google login, route the callback URL to both SDKs before passing it back to Capacitor.
复制到剪贴板 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)}iOS应用程序使用Facebook和Google登录时,路由回调URL到两个SDK,然后将其传回__CAPGO_KEEP_0__。 AppDelegate.swift 导入应用程序使用的 SDK:
import Capacitorimport FBSDKCoreKitimport GoogleSignInimport UIKit