gpt4 book ai didi

ios - Firebase 授权谷歌 + Facebook = 崩溃

转载 作者:可可西里 更新时间:2023-11-01 05:32:58 24 4
gpt4 key购买 nike

我已经在我的应用程序的 iOS 版本中成功实现了 Google Sign(Android 版本中的 Google + Twitter + Facebook 也可以正常工作)。现在我正在尝试添加 FB 登录,但它似乎与 Google 登录有冲突。当我在 WebView 中看到成功的 FB 登录屏幕并按确定后 - 应用程序崩溃。

Error Domain=com.google.GIDSignIn Code=-4 "(null)"
2016-09-01 18:51:55.745 APP_NAME[4574:] <FIRAnalytics/INFO> Firebase Analytics enabled
2016-09-01 18:52:10.039 APP_NAME[4574:3352620] -canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
2016-09-01 18:52:10.075 APP_NAME[4574:3352620] -canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
(lldb) bt
* thread #1: tid = 0x33282c, 0x014dbd54 libswiftCore.dylib`swift::_swift_getClass(void const*), queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x014dbd54 libswiftCore.dylib`swift::_swift_getClass(void const*)
frame #1: 0x014d2e62 libswiftCore.dylib`swift_getObjectType + 8
frame #2: 0x0013dba0 APP_NAME`@objc AppDelegate.application(UIApplication, open : URL, sourceApplication : String?, annotation : Any) -> Bool + 328 at AppDelegate.swift:0
frame #3: 0x001e8046 APP_NAME`-[FIRAAppDelegateProxy application:openURL:sourceApplication:annotation:] + 150
frame #4: 0x258f214a UIKit`__45-[UIApplication _applicationOpenURL:payload:]_block_invoke + 906
frame #5: 0x258f1c1a UIKit`-[UIApplication _applicationOpenURL:payload:] + 546
frame #6: 0x258f9e8a UIKit`-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 3658
frame #7: 0x258fe986 UIKit`__88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 174
frame #8: 0x258fe898 UIKit`-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 396
frame #9: 0x258ea472 UIKit`__70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 134
frame #10: 0x258ea160 UIKit`-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 644
frame #11: 0x2271cc28 FrontBoardServices`__80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke_2 + 40
frame #12: 0x22737bf6 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 18
frame #13: 0x22737aa6 FrontBoardServices`-[FBSSerialQueue _performNext] + 226
frame #14: 0x22737da4 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 44
frame #15: 0x2102b9e6 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
frame #16: 0x2102b5d6 CoreFoundation`__CFRunLoopDoSources0 + 454
frame #17: 0x2102993e CoreFoundation`__CFRunLoopRun + 806
frame #18: 0x20f781c8 CoreFoundation`CFRunLoopRunSpecific + 516
frame #19: 0x20f77fbc CoreFoundation`CFRunLoopRunInMode + 108
frame #20: 0x22594af8 GraphicsServices`GSEventRunModal + 160
frame #21: 0x256b1434 UIKit`UIApplicationMain + 144
* frame #22: 0x001439a0 APP_NAME`main + 172 at AppDelegate.swift:12
frame #23: 0x20c24872 libdyld.dylib`start + 2

来自 AppDelegate 的代码

@available(iOS 9.0, *)
func application(_ application: UIApplication,
open url: URL, options: [String: Any]) -> Bool {
print(url)
print(options)
return GIDSignIn.sharedInstance().handle(url as URL!,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication.rawValue] as? String,
annotation: options[UIApplicationOpenURLOptionsKey.annotation.rawValue])
|| FBSDKApplicationDelegate.sharedInstance().application(application, open: url,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication.rawValue] as? String,
annotation: options[UIApplicationOpenURLOptionsKey.annotation.rawValue])
}

func application(_ application: UIApplication,
open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication: sourceApplication!, annotation: annotation)
|| FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}

最佳答案

问题是由 Apple 的“创新”引起的。对于 Xcode 8 beta 6,我必须使用

@available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

关于ios - Firebase 授权谷歌 + Facebook = 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39276408/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com