在Flutter iOS中解决谷歌登录中的restricted_client错误,可以按照以下步骤进行操作:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.YOUR_CLIENT_ID</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>google</string>
<string>googlechrome</string>
<string>ghttps</string>
</array>
import UIKit
import Flutter
import GoogleSignIn
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
GIDSignIn.sharedInstance()?.clientID = "YOUR_CLIENT_ID"
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
请注意,以上步骤仅适用于解决在Flutter iOS中使用谷歌登录时出现的restricted_client错误。对于其他问题或错误,请参考相关文档或寻求开发者社区的帮助。
领取专属 10元无门槛券
手把手带您无忧上云