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

Provides functionality to share content via the Facebook Share API.

This is really just a wrapper around the Graph API functionality but can be useful for sharing content directly.



Public Methods
 MethodDefined By
  
share(content:Object):Boolean
Attempts to use the Share API to post the provided content.
ShareAPI
Events
 Event Summary Defined By
   Dispatched if the share api call was cancelled ShareAPI
   Dispatched when the Facebook share api call has completed successfully.ShareAPI
   Dispatched when an error occurred posting to the share api errorMessage will contain details on the error that occurred.ShareAPI
Method Detail
share()method
public function share(content:Object):Boolean

Attempts to use the Share API to post 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 share post was initiated and false if it is not available or there is an issue with the content

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.shareAPI.share( builder.build() );
         
Event Detail
facebookapi:shareapi:cancelled Event
Event Object Type: com.distriqt.extension.facebookapi.events.ShareAPIEvent
ShareAPIEvent.type property = com.distriqt.extension.facebookapi.events.ShareAPIEvent.CANCELLED

Dispatched if the share api call was cancelled
facebookapi:shareapi:completed Event  
Event Object Type: com.distriqt.extension.facebookapi.events.ShareAPIEvent
ShareAPIEvent.type property = com.distriqt.extension.facebookapi.events.ShareAPIEvent.COMPLETED

Dispatched when the Facebook share api call has completed successfully.

postId will contain the id of the post created.

facebookapi:shareapi:error Event  
Event Object Type: com.distriqt.extension.facebookapi.events.ShareAPIEvent
ShareAPIEvent.type property = com.distriqt.extension.facebookapi.events.ShareAPIEvent.ERROR

Dispatched when an error occurred posting to the share api

errorMessage will contain details on the error that occurred.