Provides methods to display native (i.e., non-Web-based) dialogs to the user.
If you are building an app with a urlSchemeSuffix, you should also set the appropriate
plist entry. See [FBSettings defaultUrlSchemeSuffix]
.
Inherits from: | NSObject |
Declared in: | FBDialogs.h |
canPresentMessageDialog
Determines if the device is capable of presenting the message dialog.
+ (BOOL)
canPresentMessageDialog;
This is the most basic check for capability for this feature.
FBDialogs.h
canPresentMessageDialogWithOpenGraphActionParams:
Determines whether a call to presentMessageDialogWithOpenGraphActionParams:...
will
successfully present a dialog in the Facebook Messenger app. This is useful for applications
that need to modify the available UI controls depending on whether the dialog is
available on the current platform.
參數 | 說明 |
---|---|
params | The dialog parameters |
+ (BOOL)
canPresentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params;
FBDialogs.h
canPresentMessageDialogWithParams:
Determines whether a call to presentMessageDialogWithParams:...
will successfully
present a dialog in the Facebook Messenger app. This is useful for applications that
need to modify the available UI controls depending on whether the dialog is
available on the current platform.
參數 | 說明 |
---|---|
params | The dialog parameters |
+ (BOOL)
canPresentMessageDialogWithParams:(FBLinkShareParams *)params;
FBDialogs.h
canPresentMessageDialogWithPhotos
Determines whether a call to presentMessageDialogWithPhotos:...
will successfully
present a dialog in the Facebook Messenger app. This is useful for applications that
need to modify the available UI controls depending on whether the dialog is
available on the current platform.
+ (BOOL)
canPresentMessageDialogWithPhotos;
FBDialogs.h
presentMessageDialogWithLink:handler:
Presents a dialog in the Facebook Messenger app that allows the user to share the supplied link. No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
link | The URL link to be attached to the post. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithLink: | (NSURL *)link |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding canPresentMessageDialogWithParams method is also returning YES for the same params.
FBDialogs.h
presentMessageDialogWithLink:name:handler:
Presents a dialog in the Facebook Messenger app that allows the user to share the supplied link. No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
link | The URL link to be attached to the post. |
name | The name, or title associated with the link. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithLink: | (NSURL *)link |
name: | (NSString *)name |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding canPresentMessageDialogWithParams method is also returning YES for the same params.
FBDialogs.h
presentMessageDialogWithOpenGraphAction:actionType:previewPropertyName:clientState:handler:
Presents a dialog in the Facebook Messenger app that allows the user to publish the supplied Open Graph action. No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
action | The Open Graph action to be published. May not be nil. |
actionType | The fully-specified Open Graph action type of the action (e.g., my_app_namespace:my_action). |
previewPropertyName | The name of the property on the action that represents the primary Open Graph object associated with the action; this object will be displayed in the preview portion of the share dialog. |
clientState | An NSDictionary that's passed through when the completion handler is called. This is useful for the app to maintain state about the share request that was made so as to have appropriate action when the handler is called. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithOpenGraphAction: | (id<FBOpenGraphAction>)action |
actionType: | (NSString *)actionType |
previewPropertyName: | (NSString *)previewPropertyName |
clientState: | (NSDictionary *)clientState |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params.
FBDialogs.h
presentMessageDialogWithOpenGraphActionParams:clientState:handler:
Presents a dialog in the Facebook Messenger app that allows the user to publish an Open Graph action. No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
params | The parameters for the Open Graph action dialog. |
clientState | An NSDictionary that's passed through when the completion handler is called. This is useful for the app to maintain state about the share request that was made so as to have appropriate action when the handler is called. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithOpenGraphActionParams: | (FBOpenGraphActionParams *)params |
clientState: | (NSDictionary *)clientState |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding
canPresentMessageDialogWithOpenGraphActionParams:
method is also returning YES for the same params.
FBDialogs.h
presentMessageDialogWithParams:clientState:handler:
Presents a dialog in the Facebook Messenger app that allows the user to share a status update that may include text, images, or URLs. No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
params | The parameters for the Message Dialog. The "friends" and "place" properties will be ignored as the Facebook Messenger app does not support tagging. |
clientState | An NSDictionary that's passed through when the completion handler is called. This is useful for the app to maintain state about the share request that was made so as to have appropriate action when the handler is called. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithParams: | (FBLinkShareParams *)params |
clientState: | (NSDictionary *)clientState |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding
canPresentMessageDialogWithParams:
method is also returning YES for the same params.
FBDialogs.h
presentMessageDialogWithPhotoParams:clientState:handler:
Presents a dialog in the Facebook Messenger app that allows the user to send the supplied photo(s). No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
params | The parameters for the Message Dialog |
clientState | An NSDictionary that's passed through when the completion handler is called. This is useful for the app to maintain state about the share request that was made so as to have appropriate action when the handler is called. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithPhotoParams: | (FBPhotoParams *)params |
clientState: | (NSDictionary *)clientState |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding
canPresentMessageDialogWithPhotos
method is also returning YES.
FBDialogs.h
presentMessageDialogWithPhotos:clientState:handler:
Presents a dialog in the Facebook Messenger app that allows the user to send the supplied photo(s). No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
photos | An NSArray containing UIImages to be shared. |
clientState | An NSDictionary that's passed through when the completion handler is called. This is useful for the app to maintain state about the share request that was made so as to have appropriate action when the handler is called. May be nil. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithPhotos: | (NSArray *)photos |
clientState: | (NSDictionary *)clientState |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding
canPresentMessageDialogWithPhotos
method is also returning YES.
FBDialogs.h
presentMessageDialogWithPhotos:handler:
Presents a dialog in the Facebook Messenger app that allows the user to send the supplied photo(s). No session is required, and the app does not need to be authorized to call this.
Note that this will perform an app switch to the Messenger app, and will cause the current app to be suspended. When the share is complete, the Messenger app will redirect to a url of the form "fb{APP_ID}://" that the application must handle. The app should then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger the appropriate handling. Note that FBAppCall will first try to call the completion handler associated with this method, but since during an app switch, the calling app may be suspended or killed, the app must also give a fallbackHandler to the handleOpenURL: method in FBAppCall.
參數 | 說明 |
---|---|
photos | An NSArray containing UIImages to be shared. |
handler | A completion handler that may be called when the status update is complete. May be nil. If non-nil, the handler will always be called asynchronously. |
+ (FBAppCall *)
presentMessageDialogWithPhotos: | (NSArray *)photos |
handler: | (FBDialogAppCallCompletionHandler)handler; |
A non-nil FBAppCall object is only returned if the corresponding
canPresentMessageDialogWithPhotos
method is also returning YES.
FBDialogs.h
FBDialogAppCallCompletionHandler
A block that when passed to a method in FBDialogs is called back with the results of the AppCall for that dialog.
typedef void (^FBDialogAppCallCompletionHandler)( FBAppCall *call, NSDictionary *results, NSError *error);
This will be called on the UI thread, once the AppCall completes.
FBDialogs.h
FBNativeDialogResult
Passed to a handler to indicate the result of a dialog being displayed to the user.
typedef enum { FBOSIntegratedShareDialogResultSucceeded = 0, FBOSIntegratedShareDialogResultCancelled = 1, FBOSIntegratedShareDialogResultError = 2 } FBOSIntegratedShareDialogResult;
常數 | 簡介 |
---|---|
FBOSIntegratedShareDialogResultSucceeded | Indicates that the dialog action completed successfully. |
FBOSIntegratedShareDialogResultCancelled | Indicates that the dialog action was cancelled (either by the user or the system). |
FBOSIntegratedShareDialogResultError | Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). |
Enum
FBDialogs.h