FBAppAction
This class is no longer available in the most recent version of the SDK.

The FBAppAction object is used to encapsulate state when a third party app performs an action that requires switching over to the native Facebook app.

Discussion:
  • Each FBAppAction instance will have a unique ID
  • This object is passed into an FBAppActionCompletionHandler for context
Inherits from:NSObject
Declared in:FBAppAction.h
Properties
arguments

The arguments being passed to the entity that will perform the action

@property (nonatomic, readonly, copy) NSDictionary *arguments;
Declared In: FBAppAction.h
clientState

Client JSON state that is necessary in the completion handler for complete context

@property (nonatomic, readonly, copy) NSDictionary *clientState;
Declared In: FBAppAction.h
ID

The ID of this FBAppAction instance

@property (nonatomic, readonly, copy) NSString *ID;
Declared In: FBAppAction.h
method

The method being performed for this action

@property (nonatomic, readonly, copy) NSString *method;
Declared In: FBAppAction.h
Class Methods
handleDidBecomeActive

A helper method that should be called when the application's applicationDidBecomeActive: is invoked, to maintain proper book keeping of pending FBAppActions. If any pending actions are found, their registered callbacks will be invoked with appropriate state

+ (void) handleDidBecomeActive;
Declared In: FBAppAction.h
handleOpenURL:sourceApplication:fallbackHandler:

A helper method that is used to provide an implementation for [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked for the proper processing of responses during interaction with the native Facebook app or as part of SSO authorization flow.

+ (BOOL)
handleOpenURL: (NSURL *)url
sourceApplication: (NSString *)sourceApplication
fallbackHandler: (FBAppActionCompletionHandler)handler;
Discussion:

See + handleOpenUrl:withSession:fallbackHandler:

Declared In: FBAppAction.h
handleOpenURL:sourceApplication:withSession:

A helper method that is used to provide an implementation for [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked for the proper processing of responses during interaction with the native Facebook app or as part of SSO authorization flow.

+ (BOOL)
handleOpenURL: (NSURL *)url
sourceApplication: (NSString *)sourceApplication
withSession: (FBSession *)session;
Discussion:

See + handleOpenUrl:withSession:fallbackHandler:

Declared In: FBAppAction.h
handleOpenURL:sourceApplication:withSession:fallbackHandler:

A helper method that is used to provide an implementation for [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked for the proper processing of responses during interaction with the native Facebook app or as part of SSO authorization flow.

ParameterDescription
url

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

sourceApplication

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

session

If this url is being sent back to this app as part of SSO authorization flow, then pass in the session that was being opened. A nil value defaults to FBSession.activeSession

handler

Optional handler to execute if no completion handler was found for the action in this URL. A completion handler is not a requirement for a url to be handled.

+ (BOOL)
handleOpenURL: (NSURL *)url
sourceApplication: (NSString *)sourceApplication
withSession: (FBSession *)session
fallbackHandler: (FBAppActionCompletionHandler)handler;
Declared In: FBAppAction.h
Instance Methods
isEqualToAppAction:

Compares the receiving FBAppAction to the passed in FBAppAction

- (BOOL) isEqualToAppAction:(FBAppAction *)appAction;
Declared In: FBAppAction.h
Typedefs
FBAppActionCompletionHandler

A block that is passed to performAction to register for a callback with the results of that action

typedef void (^FBAppActionCompletionHandler)(
FBAppAction *action,
NSDictionary *results,
NSError *error);
Discussion:

Pass a block of this type when calling performAction. This will be called once the action completes. The call occurs on the UI thread.

Declared In: FBAppAction.h