I manage to create an app that can share picture along with the hasthag with this facebook sdk version 4.+.
In my app I have three checkbox that each contains the option of hasthag people want to share.
With the code i currently have
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(bitmap)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.setShareHashtag(new ShareHashtag.Builder()
.setHashtag(hastag1).build())
.build();
ShareDialog.show(SelfieActivity.this,content);
Can only post one hasthag. I have tried setting the hasthag as
.setHashtag(hastag1+" "+hastag2+" "+hastag3)
Only post the first one.
Anybody knows how to post multiple hasthag?
Unfortunately Facebook only allowed one hashtag
Related
Incentivized sharing is not allowed in the Facebook SDK, but incentivized check in is allowed.
However, the check in ability has been deprecated in the SDK docs, and they say it was added to the share dialog, but there's no documentation on how to do this.
I've searched all over SO and the internet to no avail. My sharedialog works fine, but it just wont check in at the place.
What is the approved way to use the Android Facebook SDK to check in at a location?
Here's my current ShareDialog code...
Bitmap image = bitmap;
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(image)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.setShareHashtag(new ShareHashtag.Builder()
.setHashtag(hashtag)
.build())
.build();
ShareDialog.show(ShareActivity.this, content);
I tried sharing an Image with Caption on Facebook with the help of Facebook API and the code as below:
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(image)
.setCaption("Caption is Important")
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
shareDialog.show(content);
It open up the ShareDialog but the caption wont appear in it the dialog
As per the facebook documentation shared CBroe:
https://developers.facebook.com/policy#control
According to its policy 2.3 it states that
Don't prefill captions, comments, messages, or the user message parameter of posts with content a person or business didn’t create, even if the person can edit or remove the content before sharing. You may use our Share Dialogs to prefill a single hashtag in a post, but don't prefill any content a person or business didn't create via the API.
So we are no longer allowed to pre-fill captions for images by using shareDialog or by using any other method.
You can add caption with the given method. But at share dialog of facebook. You have to manually type your caption.
I am developing an Android app. In my app, I am integrating Facebook photo share feature. This is my first Android app with Facebook integration. I am able to share photo to user timeline now. But I am having problem with setting description to that image.
This is my Facebook share photo function
private void sharePhotoToFacebook(){
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(shareBitmap)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareApi.share(content, null);
}
When photo shared it shows like this in timeline
As you can see there is no description or title. What I want is I want to set title or description. Is there any function can do like below
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo).setCaption("Description")
.build();
How can I set title?
Write setCaption() method as below:
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(shareBitmap)
.setCaption("Description")
.build();
Note: need to use SDK vertion 4+. Means at least 4.1
compile 'com.facebook.android:facebook-android-sdk:4.+'
As per Facebook Platform Policies (2.3) you cannot set caption from your app. Read this note from documentation.
setCaption(String)
Sets the user generated caption for the photo. Note that the 'caption' must come from the user, as pre-filled content is forbidden by the Platform Policies (2.3).
I follow facebook's tutorial and I want to share my application screen shot so i used code on below.But it didn't also i can be log in.
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(bm)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareDialog shareDialog1 = new ShareDialog(Oyun.this);
shareDialog1.show(content);
Please visit this answer given by this guy he share photos as well as include caption with it
How to share photo with CAPTION via Android share intent on Facebook?
You need to make a simple intent to Facebook for it and you can share it. Just go through the above answer and you will find it out very easy.
I've poured through the documentation, and it appears as though it is not possible to simply share a local user generated image through the ShareDialog provided in the SDK?
Can someone confirm if this is indeed the case? If it is possible, how can I do this? I only ask because it is possible to do this through OpenGraphActionDialogBuilder via setImageAttachmentsForAction, but not ShareDialogBuilder.(ex: Posting photo from a native ShareDialog in Facebook android SDK)
All I want to do is to post a status update with an image, I don't want to create link to another URL, which is required by the OpenGraphActionDialogBuilder.
It's an old question but here is my solution with the latest Facebook API:
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.scrat);
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(image)
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareDialog dlg = new ShareDialog(MainActivity.this);
if(dlg.canShow(SharePhotoContent.class)){
dlg.show(content);
}
Don't forget you have to be logged.