Packagecom.distriqt.extension.facebookapi.share
Interfacepublic interface ShareDialog extends flash.events.IEventDispatcher

Provides functionality to share content via the Facebook Share Dialog



Public Methods
 MethodDefined By
  
canShow(type:String):Boolean
Indicates whether it is possible to show the dialog for ShareContent of the specified type.
ShareDialog
  
show(content:Object):Boolean
Shows a share dialog using the provided content.
ShareDialog
Events
 Event Summary Defined By
   Dispatched when the user cancelled a share dialog ShareDialog
   Dispatched when the Facebook share dialog has completed successfully.ShareDialog
   Dispatched when an error occurred posting from a dialog errorMessage will contain details on the error that occurred.ShareDialog
Method Detail
canShow()method
public function canShow(type:String):Boolean

Indicates whether it is possible to show the dialog for ShareContent of the specified type.

Parameters

type:String — The TYPE definition on the builder you wish to check eg ShareLinkContentBuilder.TYPE

Returns
Booleantrue if the dialog type can be shown and false otherwise
show()method 
public function show(content:Object):Boolean

Shows a share dialog using the provided content.

You must create the content using one of the builders:

Parameters

content:Object — Share content created using one of the builders

Returns
Booleantrue if the dialog will be displayed and false if it is not available

Example
Share a link using the ShareLinkContentBuilder
         var builder:ShareLinkContentBuilder = new ShareLinkContentBuilder()
             .setContentTitle("FacebookAPI ANE")
             .setContentDescription("This link was shared using the distriqt FacebookAPI ANE" )
             .setContentUrl("https://airnativeextensions.com/extension/com.distriqt.FacebookAPI");
         
         var success:Boolean = FacebookAPI.service.shareDialog.show( builder.build() );
         
Event Detail
facebookapi:dialog:cancelled Event
Event Object Type: com.distriqt.extension.facebookapi.events.ShareDialogEvent
ShareDialogEvent.type property = com.distriqt.extension.facebookapi.events.ShareDialogEvent.DIALOG_CANCELLED

Dispatched when the user cancelled a share dialog
facebookapi:dialog:completed Event  
Event Object Type: com.distriqt.extension.facebookapi.events.ShareDialogEvent
ShareDialogEvent.type property = com.distriqt.extension.facebookapi.events.ShareDialogEvent.DIALOG_COMPLETED

Dispatched when the Facebook share dialog has completed successfully.

postId will contain the id of the post created.

facebookapi:dialog:error Event  
Event Object Type: com.distriqt.extension.facebookapi.events.ShareDialogEvent
ShareDialogEvent.type property = com.distriqt.extension.facebookapi.events.ShareDialogEvent.DIALOG_ERROR

Dispatched when an error occurred posting from a dialog

errorMessage will contain details on the error that occurred.