隐私清单和 iOS URL 处理程序
复制一个包含安装步骤和本插件完整 Markdown 指南的配置提示。
隐私清单
隐私清单如果您使用Google、Facebook或Apple登录,必须在应用程序中声明这些SDK收集的数据。将文件添加到您的应用程序中 PrivacyInfo.xcprivacy 在您的应用程序中添加文件 ios/App/PrivacyInfo.xcprivacy.
不要将此文件添加到插件包中。根据您的应用程序使用情况和SDK提供商文档调整数据类型。
Google Sign-In示例
隐私清单{ "NSPrivacyCollectedDataTypes": [ { "NSPrivacyCollectedDataType": "EmailAddress", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "Name", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "UserID", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false } ]}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登录示例
Apple Sign-In 示例{ "NSPrivacyCollectedDataTypes": [ { "NSPrivacyCollectedDataType": "EmailAddress", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false }, { "NSPrivacyCollectedDataType": "Name", "NSPrivacyCollectedDataTypeLinked": true, "NSPrivacyCollectedDataTypeTracking": false } ]}查看 Apple隐私声明文档 所有允许的键和值
结合Facebook和Google URL处理程序
当iOS应用程序使用Facebook和Google登录时,路由回调URL到两个SDK,然后将其传递回__CAPGO_KEEP_0__。当 iOS 应用程序同时使用 Facebook 和 Google 登录时,路由回调 URL 到两个 SDK 之前,传递回 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)}导入应用程序使用的SDK: AppDelegate.swift 导入应用程序使用的SDK:
import Capacitorimport FBSDKCoreKitimport GoogleSignInimport UIKit