ShareApi
Đã có phiên bản mới hơn của lớp này. Hãy kiểm tra phiên bản mới nhất.

Provides an interface for sharing through the graph API. Using this class requires an access token in AccessToken.currentAccessToken that has been granted the "publish_actions" permission.

Mở rộng:Object
Gói:share
Xây dựng
ShareApi(ShareContent)

Constructs a new instance.

public ShareApi(ShareContent shareContent)
Thông sốMô tả
shareContentThe content to share.
Phương thức nhóm
share(ShareContent, FacebookCallback)

Convenience method to share a piece of content.

public static void share(ShareContent shareContent, FacebookCallback callback)
Thông sốMô tả
shareContentThe content to share.
callbackThe callback to call once the share is complete.
Phương thức thực thể
getMessage()

Returns the message the person has provided through the custom dialog that will accompany the share content.

public String getMessage()
Returns
The message.
setMessage(String)

Sets the message the person has provided through the custom dialog that will accompany the share content.

public void setMessage(String message)
Thông sốMô tả
messageThe message.
getGraphNode()

Returns the graph node to share to.

public String getGraphNode()
Returns
The graph node.
setGraphNode(String)

Sets the graph node to share to (this can be a user id, event id, page id, group id, album id, etc).

public void setGraphNode(String graphNode)
Thông sốMô tả
graphNodeThe graph node to share to.
getShareContent()

Returns the content to be shared.

public ShareContent getShareContent()
Returns
The content to be shared.
canShare()

Returns true if the content can be shared. Warns if the access token is missing the publish_actions permission. Doesn't fail when this permission is missing, because the app could have been granted that permission in another installation.

public boolean canShare()
Returns
True if the content can be shared.
share(FacebookCallback)

Share the content.

public void share(FacebookCallback callback)
Thông sốMô tả
callbackThe callback to call once the share is complete.