11.05.0 (if issue is Swift related)[Cocoapods] version 5.8.0Facebook Login popup doesn't dismiss after completing successful login
What actually happened? Can you provide a stack trace?
No error is shown or app doesn't crash but console display following warning
Can't end BackgroundTask: no background task exists identifier 5 (0x5), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
Note: Remember to format your code for readability:
AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return ApplicationDelegate.shared.application(app, open: url, options: options)
}
ViewController.swift
override func viewDidLoad() {
super.viewDidLoad()
let loginButton = FBLoginButton()
loginButton.permissions = ["public_profile", "email"]
loginButton.center = view.center
view.addSubview(loginButton)
}
https://github.com/facebook/facebook-ios-sdk/issues/1074#issuecomment-551619270
Hi
After we upgraded our iOS to 13.x version, changed FBlogin pods and login codes like in the link above. I had this problem too and it has resolved with that codes.
I wish it will help you.
I've exactly the same issue. Any updates?
If you start a new project and have the SceneKit integration in it.
To solve the issue
AppDelegate.swift and Info.plist files.var window: UIWindow? to AppDelegate.swift@Akshay-bcat Does your app use SceneKit, and if so, does the above fix work for you?
After upgraded my iPhone to iOS 13.3 the problem solved.
I am having the same issue.
I am not using SceneKit.
SwiftUI
Xcode 11.3
iOS 13.3
Interestingly the view dismisses as expected when I login in using the email / phone number option but not if I go through the app.
@Akshay-bcat @MattBlack01 Adding the following to SceneDelegate.swift should resolve the issue:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let openURLContext = URLContexts.first {
ApplicationDelegate.shared.application(UIApplication.shared,
open: openURLContext.url,
sourceApplication: openURLContext.options.sourceApplication,
annotation: openURLContext.options.annotation)
}
}
Most helpful comment
@Akshay-bcat @MattBlack01 Adding the following to SceneDelegate.swift should resolve the issue: