Skip to content

Instantly share code, notes, and snippets.

@angelolloqui
angelolloqui / FacebookSignInHelper.swift
Created October 14, 2024 12:08
Facebook login alternative to avoid issues with IDFA
import Foundation
import AuthenticationServices
import SafariServices
import FacebookCore
// This helper is a workaroung for the issue in https://github.com/facebook/facebook-ios-sdk/issues/2387
// Starting with new FBSDK 17.0.0, the login method is not working as expected when the user has not given IDFA consent
// The workaround is to use ASWebAuthenticationSession to open the SafariViewController to perform the login manually
public class FacebookSignInHelper: NSObject, ASWebAuthenticationPresentationContextProviding {