public final class ShareInternalUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MY_PHOTOS |
Modifier and Type | Method and Description |
---|---|
static android.util.Pair<java.lang.String,java.lang.String> |
getFieldNameAndNamespaceFromFullName(java.lang.String fullName) |
static LikeView.ObjectType |
getMostSpecificObjectType(LikeView.ObjectType objectType1,
LikeView.ObjectType objectType2) |
static java.lang.String |
getNativeDialogCompletionGesture(android.os.Bundle result)
Returns the gesture with which the user completed the native dialog.
|
static boolean |
getNativeDialogDidComplete(android.os.Bundle result)
Determines whether the native dialog completed normally (without error or exception).
|
static java.util.List<java.lang.String> |
getPhotoUrls(SharePhotoContent photoContent,
java.util.UUID appCallId) |
static java.lang.String |
getShareDialogPostId(android.os.Bundle result)
Returns the id of the published post.
|
static ResultProcessor |
getShareResultProcessor(FacebookCallback<Sharer.Result> callback) |
static java.lang.String |
getVideoUrl(ShareVideoContent videoContent,
java.util.UUID appCallId) |
static boolean |
handleActivityResult(int requestCode,
int resultCode,
android.content.Intent data,
ResultProcessor resultProcessor) |
static void |
invokeCallbackWithError(FacebookCallback<Sharer.Result> callback,
java.lang.String error) |
static void |
invokeCallbackWithException(FacebookCallback<Sharer.Result> callback,
java.lang.Exception exception) |
static void |
invokeCallbackWithResults(FacebookCallback<Sharer.Result> callback,
java.lang.String postId,
GraphResponse graphResponse) |
static GraphRequest |
newPostOpenGraphActionRequest(AccessToken accessToken,
org.json.JSONObject openGraphAction,
GraphRequest.Callback callback)
Creates a new Request configured to publish an Open Graph action.
|
static GraphRequest |
newPostOpenGraphObjectRequest(AccessToken accessToken,
org.json.JSONObject openGraphObject,
GraphRequest.Callback callback)
Creates a new Request configured to create a user owned Open Graph object.
|
static GraphRequest |
newPostOpenGraphObjectRequest(AccessToken accessToken,
java.lang.String type,
java.lang.String title,
java.lang.String imageUrl,
java.lang.String url,
java.lang.String description,
org.json.JSONObject objectProperties,
GraphRequest.Callback callback)
Creates a new Request configured to create a user owned Open Graph object.
|
static GraphRequest |
newStatusUpdateRequest(AccessToken accessToken,
java.lang.String message,
GraphRequest.Callback callback)
Creates a new Request configured to post a status update to a user's feed.
|
static GraphRequest |
newStatusUpdateRequest(AccessToken accessToken,
java.lang.String message,
org.json.JSONObject place,
java.util.List<org.json.JSONObject> tags,
GraphRequest.Callback callback)
Creates a new Request configured to post a status update to a user's feed.
|
static GraphRequest |
newUpdateOpenGraphObjectRequest(AccessToken accessToken,
org.json.JSONObject openGraphObject,
GraphRequest.Callback callback)
Creates a new Request configured to update a user owned Open Graph object.
|
static GraphRequest |
newUpdateOpenGraphObjectRequest(AccessToken accessToken,
java.lang.String id,
java.lang.String title,
java.lang.String imageUrl,
java.lang.String url,
java.lang.String description,
org.json.JSONObject objectProperties,
GraphRequest.Callback callback)
Creates a new Request configured to update a user owned Open Graph object.
|
static GraphRequest |
newUploadPhotoRequest(java.lang.String graphPath,
AccessToken accessToken,
android.graphics.Bitmap image,
java.lang.String caption,
android.os.Bundle params,
GraphRequest.Callback callback)
Creates a new Request configured to upload a photo to the specified graph path.
|
static GraphRequest |
newUploadPhotoRequest(java.lang.String graphPath,
AccessToken accessToken,
java.io.File file,
java.lang.String caption,
android.os.Bundle params,
GraphRequest.Callback callback)
Creates a new Request configured to upload a photo to the specified graph path.
|
static GraphRequest |
newUploadPhotoRequest(java.lang.String graphPath,
AccessToken accessToken,
android.net.Uri photoUri,
java.lang.String caption,
android.os.Bundle params,
GraphRequest.Callback callback)
Creates a new Request configured to upload a photo to the specified graph path.
|
static GraphRequest |
newUploadStagingResourceWithImageRequest(AccessToken accessToken,
android.graphics.Bitmap image,
GraphRequest.Callback callback)
Creates a new Request configured to upload an image to create a staging resource.
|
static GraphRequest |
newUploadStagingResourceWithImageRequest(AccessToken accessToken,
java.io.File file,
GraphRequest.Callback callback)
Creates a new Request configured to upload an image to create a staging resource.
|
static GraphRequest |
newUploadStagingResourceWithImageRequest(AccessToken accessToken,
android.net.Uri imageUri,
GraphRequest.Callback callback)
Creates a new Request configured to upload an image to create a staging resource.
|
static void |
registerSharerCallback(int requestCode,
CallbackManager callbackManager,
FacebookCallback<Sharer.Result> callback) |
static void |
registerStaticShareCallback(int requestCode) |
static org.json.JSONArray |
removeNamespacesFromOGJsonArray(org.json.JSONArray jsonArray,
boolean requireNamespace) |
static org.json.JSONObject |
removeNamespacesFromOGJsonObject(org.json.JSONObject jsonObject,
boolean requireNamespace) |
static org.json.JSONObject |
toJSONObjectForCall(java.util.UUID callId,
ShareOpenGraphContent content) |
static org.json.JSONObject |
toJSONObjectForWeb(ShareOpenGraphContent shareOpenGraphContent) |
public static final java.lang.String MY_PHOTOS
public static void invokeCallbackWithException(FacebookCallback<Sharer.Result> callback, java.lang.Exception exception)
public static void invokeCallbackWithError(FacebookCallback<Sharer.Result> callback, java.lang.String error)
public static void invokeCallbackWithResults(FacebookCallback<Sharer.Result> callback, java.lang.String postId, GraphResponse graphResponse)
public static boolean getNativeDialogDidComplete(android.os.Bundle result)
result
- the bundle passed back to onActivityResultpublic static java.lang.String getNativeDialogCompletionGesture(android.os.Bundle result)
result
- the bundle passed back to onActivityResultpublic static java.lang.String getShareDialogPostId(android.os.Bundle result)
result
- the bundle passed back to onActivityResultpublic static boolean handleActivityResult(int requestCode, int resultCode, android.content.Intent data, ResultProcessor resultProcessor)
public static ResultProcessor getShareResultProcessor(FacebookCallback<Sharer.Result> callback)
public static void registerStaticShareCallback(int requestCode)
public static void registerSharerCallback(int requestCode, CallbackManager callbackManager, FacebookCallback<Sharer.Result> callback)
public static java.util.List<java.lang.String> getPhotoUrls(SharePhotoContent photoContent, java.util.UUID appCallId)
public static java.lang.String getVideoUrl(ShareVideoContent videoContent, java.util.UUID appCallId)
public static org.json.JSONObject toJSONObjectForCall(java.util.UUID callId, ShareOpenGraphContent content) throws org.json.JSONException
org.json.JSONException
public static org.json.JSONObject toJSONObjectForWeb(ShareOpenGraphContent shareOpenGraphContent) throws org.json.JSONException
org.json.JSONException
public static org.json.JSONArray removeNamespacesFromOGJsonArray(org.json.JSONArray jsonArray, boolean requireNamespace) throws org.json.JSONException
org.json.JSONException
public static org.json.JSONObject removeNamespacesFromOGJsonObject(org.json.JSONObject jsonObject, boolean requireNamespace)
public static android.util.Pair<java.lang.String,java.lang.String> getFieldNameAndNamespaceFromFullName(java.lang.String fullName)
public static GraphRequest newPostOpenGraphObjectRequest(AccessToken accessToken, org.json.JSONObject openGraphObject, GraphRequest.Callback callback)
accessToken
- the accessToken to use, or nullopenGraphObject
- the Open Graph object to create; must not be null, and must have a
non-empty type and titlecallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newPostOpenGraphObjectRequest(AccessToken accessToken, java.lang.String type, java.lang.String title, java.lang.String imageUrl, java.lang.String url, java.lang.String description, org.json.JSONObject objectProperties, GraphRequest.Callback callback)
accessToken
- the access token to use, or nulltype
- the fully-specified Open Graph object type (e.g.,
my_app_namespace:my_object_name); must not be nulltitle
- the title of the Open Graph object; must not be nullimageUrl
- the link to an image to be associated with the Open Graph object; may
be nullurl
- the url to be associated with the Open Graph object; may be nulldescription
- the description to be associated with the object; may be nullobjectProperties
- any additional type-specific properties for the Open Graph object;
may be nullcallback
- a callback that will be called when the request is completed to
handle success or error conditions; may be nullpublic static GraphRequest newPostOpenGraphActionRequest(AccessToken accessToken, org.json.JSONObject openGraphAction, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullopenGraphAction
- the Open Graph action to create; must not be null, and must have a
non-empty 'type'callback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newUpdateOpenGraphObjectRequest(AccessToken accessToken, org.json.JSONObject openGraphObject, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullopenGraphObject
- the Open Graph object to update, which must have a valid 'id'
propertycallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newUpdateOpenGraphObjectRequest(AccessToken accessToken, java.lang.String id, java.lang.String title, java.lang.String imageUrl, java.lang.String url, java.lang.String description, org.json.JSONObject objectProperties, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullid
- the id of the Open Graph objecttitle
- the title of the Open Graph objectimageUrl
- the link to an image to be associated with the Open Graph objecturl
- the url to be associated with the Open Graph objectdescription
- the description to be associated with the objectobjectProperties
- any additional type-specific properties for the Open Graph objectcallback
- a callback that will be called when the request is completed to
handle success or error conditionspublic static GraphRequest newUploadPhotoRequest(java.lang.String graphPath, AccessToken accessToken, android.graphics.Bitmap image, java.lang.String caption, android.os.Bundle params, GraphRequest.Callback callback)
graphPath
- the graph path to useaccessToken
- the access token to use, or nullimage
- the image to uploadcaption
- the user generated caption for the photo.params
- the parameterscallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newUploadPhotoRequest(java.lang.String graphPath, AccessToken accessToken, java.io.File file, java.lang.String caption, android.os.Bundle params, GraphRequest.Callback callback) throws java.io.FileNotFoundException
graphPath
- the graph path to useaccessToken
- the access token to use, or nullfile
- the file containing the photo to uploadcaption
- the user generated caption for the photo.params
- the parameterscallback
- a callback that will be called when the request is completed to handle
success or error conditionsjava.io.FileNotFoundException
public static GraphRequest newUploadPhotoRequest(java.lang.String graphPath, AccessToken accessToken, android.net.Uri photoUri, java.lang.String caption, android.os.Bundle params, GraphRequest.Callback callback) throws java.io.FileNotFoundException
graphPath
- the graph path to useaccessToken
- the access token to use, or nullphotoUri
- the file:// or content:// Uri to the photo on device.caption
- the user generated caption for the photo.params
- the parameterscallback
- a callback that will be called when the request is completed to handle
success or error conditionsjava.io.FileNotFoundException
public static GraphRequest newStatusUpdateRequest(AccessToken accessToken, java.lang.String message, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullmessage
- the text of the status updatecallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newStatusUpdateRequest(AccessToken accessToken, java.lang.String message, org.json.JSONObject place, java.util.List<org.json.JSONObject> tags, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullmessage
- the text of the status updateplace
- an optional place to associate with the posttags
- an optional list of users to tag in the postcallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newUploadStagingResourceWithImageRequest(AccessToken accessToken, android.graphics.Bitmap image, GraphRequest.Callback callback)
accessToken
- the access token to use, or nullimage
- the image to uploadcallback
- a callback that will be called when the request is completed to handle
success or error conditionspublic static GraphRequest newUploadStagingResourceWithImageRequest(AccessToken accessToken, java.io.File file, GraphRequest.Callback callback) throws java.io.FileNotFoundException
accessToken
- the access token to use, or nullfile
- the file containing the image to uploadcallback
- a callback that will be called when the request is completed to handle
success or error conditionsjava.io.FileNotFoundException
public static GraphRequest newUploadStagingResourceWithImageRequest(AccessToken accessToken, android.net.Uri imageUri, GraphRequest.Callback callback) throws java.io.FileNotFoundException
accessToken
- the access token to use, or nullimageUri
- the file:// or content:// Uri pointing to the image to uploadcallback
- a callback that will be called when the request is completed to handle
success or error conditionsjava.io.FileNotFoundException
public static LikeView.ObjectType getMostSpecificObjectType(LikeView.ObjectType objectType1, LikeView.ObjectType objectType2)