Use the Facebook Android SDK ShareDialog to check in at a location - android

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);

Related

Multiple Hasthag on Facebook Share Android

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

How to add location and description with the photo shared to be shared on facebook using Android

I can successfully share a photo on Facebook from my Android Application using following code of Facebook SDK:
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareDialog shareDialog = new ShareDialog(SpecificLocationActivity.this);
shareDialog.show(content, ShareDialog.Mode.AUTOMATIC);
However, I would like to know how to autofill description and attach location with this photo.
Although facebook shows these options when ShareDialog is launched, but I want it to be auto filled.
Thanks.

How to set description or title to Facebook photo share with PhotoShareContent in Android

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).

How to share photos on facebook with android programmatically

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.

Facebook-Android-SDK v3.6 ShareDialog attach bitmap

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.

Categories

Resources