我已经通过我的应用程序成功登录Facebook大概50到100次,但现在它无法正常工作。我得到了登录屏幕并且可以输入我的FB登录信息或者由于已经登录而点击继续。当登录屏幕被解除时,回调被调用但是result.isCancelled总是为真。这是我正在使用的委托函数:
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result:
FBSDKLoginManagerLoginResult!, error: Error!) {
print(result.isCancelled) //always returning true
}
以下是appDelegate中的内容:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
let handled = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
return handled
}
func applicationDidBecomeActive(_ application: UIApplication) {
FBSDKAppEvents.activateApp()
}
有没有办法检查应用的激活状态?我想知道问题是否在一般设置中(例如,p-list,Facebook开发者网站等)。
更新:我现在也在FB股上崩溃,我之前也检查过。这是错误消息。似乎这些必须是相关的。
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000101b2faa4 libswiftCore.dylib`swift_getObjectType + 60
frame #1: 0x00000001005d6acc Word Duel`@objc AppDelegate.application(_:open:sourceApplication:annotation:) at AppDelegate.swift:0
frame #2: 0x000000018e678acc UIKit`__58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 880
frame #3: 0x000000018e678440 UIKit`-[UIApplication _applicationOpenURLAction:payload:origin:] + 596
frame #4: 0x0000000199a75990 SafariServices`-[SFSafariViewController remoteViewController:hostApplicationOpenURL:] + 216
frame #5: 0x0000000199a67834 SafariServices`-[SFBrowserRemoteViewController willOpenURLInHostApplication:] + 76
frame #6: 0x00000001846ca580 CoreFoundation`__invoking___ + 144
frame #7: 0x00000001845a9748 CoreFoundation`-[NSInvocation invoke] + 284
frame #8: 0x0000000102379220 libdispatch.dylib`_dispatch_client_callout + 16
frame #9: 0x0000000102385850 libdispatch.dylib`_dispatch_block_invoke_direct + 232
frame #10: 0x0000000186ef4878 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
frame #11: 0x0000000186ef451c FrontBoardServices`-[FBSSerialQueue _performNext] + 404
frame #12: 0x0000000186ef4ab8 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 56
frame #13: 0x000000018466b404 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #14: 0x000000018466ac2c CoreFoundation`__CFRunLoopDoSources0 + 276
frame #15: 0x000000018466879c CoreFoundation`__CFRunLoopRun + 1204
frame #16: 0x0000000184588da8 CoreFoundation`CFRunLoopRunSpecific + 552
frame #17: 0x000000018656b020 GraphicsServices`GSEventRunModal + 100
frame #18: 0x000000018e56978c UIKit`UIApplicationMain + 236
* frame #19: 0x00000001005d89c0 Word Duel`main at AppDelegate.swift:18
frame #20: 0x0000000184019fc0 libdyld.dylib`start + 4