| Package | com.distriqt.extension.facebookapi.share |
| Interface | public 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.
| Method | Defined By | ||
|---|---|---|---|
share(content:Object):Boolean
Attempts to use the Share API to post the provided content. | ShareAPI | ||
| 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 | |||
| 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:
ShareLinkContentBuilderSharePhotoContentBuilderShareVideoContentBuilderShareMediaContentBuilderShareOpenGraphContentBuilderParameters
content:Object — Share content created using one of the builders
|
Boolean — true if the share post was initiated and false if it is not available or there is an issue with the content
|
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() );
| facebookapi:shareapi:cancelled | Event |
com.distriqt.extension.facebookapi.events.ShareAPIEventcom.distriqt.extension.facebookapi.events.ShareAPIEvent.CANCELLEDDispatched if the share api call was cancelled
| facebookapi:shareapi:completed | Event |
com.distriqt.extension.facebookapi.events.ShareAPIEventcom.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 |
com.distriqt.extension.facebookapi.events.ShareAPIEventcom.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.