iOS SDK Version

FBSDKApplicationDelegate

@interfaceFBSDKApplicationDelegate:NSObject
The FBSDKApplicationDelegate is designed to post process the results from Facebook Login or Facebook Dialogs (or any action that requires switching over to the native Facebook app or Safari).
The methods in this class are designed to mirror those in UIApplicationDelegate, and you should call them in the respective methods in your AppDelegate implementation.
  • Unavailable
    Undocumented

    Declaration

    Objective-C
    -(instancetype)initNS_UNAVAILABLE;
  • Unavailable
    Undocumented

    Declaration

    Objective-C
    +(instancetype)newNS_UNAVAILABLE;
  • Gets the singleton instance.

    Declaration

    Objective-C
    @property(class,nonatomic,strong,readonly)NS_SWIFT_NAME(shared)FBSDKApplicationDelegate*sharedInstance;
    Swift
    classvarshared:ApplicationDelegate{get}
  • Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs.

    Declaration

    Objective-C
    -(BOOL)application:(nonnullUIApplication*)applicationopenURL:(nonnullNSURL*)urlsourceApplication:(nullableNSString*)sourceApplicationannotation:(nullableid)annotation;
    Swift
    funcapplication(_application:UIApplication,openurl:URL,sourceApplication:String?,annotation:Any?)->Bool

    Parameters

    application
    The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
    url
    The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
    sourceApplication
    The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
    annotation
    The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].

    Return Value

    YES if the url was intended for the Facebook SDK, NO if not.
  • Call this method from the [UIApplicationDelegate application:openURL:options:] method of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs.

    Declaration

    Objective-C
    -(BOOL)application:(nonnullUIApplication*)applicationopenURL:(nonnullNSURL*)urloptions:(nonnullNSDictionary<UIApplicationOpenURLOptionsKey,id>*)options;
    Swift
    funcapplication(_application:UIApplication,openurl:URL,options:[UIApplication.OpenURLOptionsKey:Any]=[:])->Bool

    Parameters

    application
    The application as passed to [UIApplicationDelegate application:openURL:options:].
    url
    The URL as passed to [UIApplicationDelegate application:openURL:options:].
    options
    The options dictionary as passed to [UIApplicationDelegate application:openURL:options:].

    Return Value

    YES if the url was intended for the Facebook SDK, NO if not.
  • Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. As part of SDK initialization basic auto logging of app events will occur, this can be controlled via ‘FacebookAutoLogAppEventsEnabled’ key in the project info plist file.

    Declaration

    Objective-C
    -(BOOL)application:(nonnullUIApplication*)applicationdidFinishLaunchingWithOptions:(nullableNSDictionary<UIApplicationLaunchOptionsKey,id>*)launchOptions;
    Swift
    funcapplication(_application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[UIApplication.LaunchOptionsKey:Any]?=nil)->Bool

    Parameters

    application
    The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
    launchOptions
    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].

    Return Value

    YES if the url was intended for the Facebook SDK, NO if not.
  • Call this method to manually initialize SDK. As we initialize SDK automatically, this should only be called when auto initialization is disabled, this can be controlled via ‘FacebookAutoInitEnabled’ key in the project info plist file.

    Declaration

    Objective-C
    +(void)initializeSDK:(nullableNSDictionary<UIApplicationLaunchOptionsKey,id>*)launchOptions;
    Swift
    classfuncinitializeSDK(_launchOptions:[UIApplication.LaunchOptionsKey:Any]?)

    Parameters

    launchOptions
    The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. Could be nil if you don’t call this function from [UIApplicationDelegate application:didFinishLaunchingWithOptions:].