Facebook "feed" dialog Display Issue - android

I am Trying to post on facebook with the help of "feed" dialog. I supply some information in post like "link","picture","caption","description","title" etc.
But when i share the post the preview look like the image below:
My Concern is this I want to show description right align to the dialog after the Image ends. Can i do this by some change in my code.
The updated Screen looks something Like the Image Below:
mFacebook.dialog(MyActivity.this, "feed",parameters, new FbDialogListener());
Where parameter is the object of Bundle contains all the values to be posted on Facebook.
There is the same issue with Iphone SDK too.

You can't do this, the dialogs are rendered from Facebook's side, as is the content itself once posted. You also appear to have attempted to embed HTML in the description, this will also not work as Facebook will not render client-supplied HTML in their interface.

Do not use Facebook's dialog, you can create your own views (e.g. UIView in iOS or View in Android) similar to the second dialog (or whatever you like). On share button tap you can use Facebook's graph API to share it on your wall.
iOS example
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:[appDelegate.facebook accessToken],#"access_token",
<your FB app id>, #"api_key",
<message you want to post>, #"message",
imageData, #"source",
nil];
[appDelegate.facebook requestWithGraphPath:#"me/feed"
andParams:params
andHttpMethod:#"POST"
andDelegate:appDelegate];
See here for graph API.
I am using a similar approach in my iOS app. I designed the share dialog almost similar to Facebook's share UI.

Related

How do I share Facebook contents on Android

I'm trying to share a post on my FB wall by an Android native app.
I'm following the official guide available # FBOfficial
I would know if it's possible to share a text, an image and an hashtag and also tag place or friends in the same post.
I tried to use the ShareContent class with no results.
If I use
new SharePhotoContent.Builder()...
it's not possible to add text, because the method "setQuote" is not available.
Otherwise, if I use
new ShareLinkContent.Builder()
it's not possible to add a picture.
I would also know why
setShareHashtag(new ShareHashtag.Builder())
works perfectly but
setPlaceId(String placeId)
never works, also if I add a valid placeId taken from PlaceIds
Is there a way to solve my problem?
TY in advance

Android - Firebase Dynamic Social Meta Tags Links on Google +

I have an application with dynamic links implemented. I'm making request to get short link with all socialMetaTagInfo defined (socialTitle, socialDescription, socialImageLink)
link is so far only dummy page with simple and whole request looks like this (I'm not filling more fields):
{
"dynamicLinkInfo": {
"dynamicLinkDomain": "dl_domain",
"link": "http://www.my_page.com",
"androidInfo": {
"androidPackageName": string
},
"socialMetaTagInfo": {
"socialTitle": string,
"socialDescription": string,
"socialImageLink": string
}
}
}
When I share result short link on Facebook I can see nice post with image, title and description. However when I share the link via Google + only link is visible without social fields. (Same for Slack for example).
Do I have to create my fallback page first? Or am I doing something wrong? I just want to know how to display the image, title and description in other social apps (pages).
Title,Desc,Images are the additional meta tags which is added to your Dynamic links.
Apps like Facebook, Twitter, Google+ will be identifying the meta data from your url and load it in the UI.
It may fail to load if the Image size is large or if Google+ app is not coded to handle it.

like open graph object from native android like button FB SDK V 4

I am trying to implement Facebook like button using LikeView in my Android app. I have integrated SDK4 with the app.
I want to like a photo published by my friend.
This is my code
LikeView likeView = new LikeView(this);
likeView.setObjectIdAndType("123456789", LikeView.ObjectType.OPEN_GRAPH);
The first parameter is Facebook Open Graph object id for a photo.
The error response is :
error={"error_code":10,"error":"server_error","error_description":"Error
connecting to Facebook servers. Please try again
later.","error_reason":"server_error"}
If I just replace the second line of code with this, it is working well.
likeView.setObjectIdAndType("https://www.facebook.com/FacebookDevelopers", LikeView.ObjectType.PAGE);
Documentation says that the first parameter i.e. object ID for the Like button can be a URL or a Facebook ID. Please suggest.
Update
I filed a bug report for this. And this is the response from Facebook.
Sorry to say that like view cannot be used to like photos. It is
designed to like page/open graph type only. I suggest that you use
graph api to like the photo.

How to like a website from my Android application

I have an application that show to the user articles from news feeds.
I want to add Facebook like mechanism, that when the user push the like button,
his Facebook account will show that he is like this article.
So, I downloaded the Facebook sdk, and worked with the open graph example.
The problem is that I can't find any good example of how to to this.
I understand that I have action types, and object types. I added action type of me/og.likes and now I need to send the url of the selected article.
What I do so far is:
I have this lines, what they do is only add which type of action my application can handle.
this is working fine.
Bundle params = new Bundle();
params.putString("object", "http://samples.ogp.me/226075010839791");
Request request = new Request(
Session.getActiveSession(),
"me/og.likes",
params,
HttpMethod.POST
);
Response response = request.executeAndWait();
// handle the response
Now I want to send the actual url of the selected article, do I need to use some kind of outside url of an object or I can build object in my application and send it?
Any help would be great,
thanks.
When creating an action you must be sure that facebook robot can see the URL and correct meta tags. You can debug your page on this page. So in your case as I understand facebook can't visit your application and therefore can't determine meta tags in your app. So the solution I can offer is creating a web page which will generate meta tags depending on the $_GET[] parameter. You can pass an article ID and generate meta tags for that ID.
There is library which completely solve this issue (project page):
dependencies {
compile 'com.shamanland:facebook-like-button:0.1.8'
}
The simplest way to add like button:
<com.shamanland.facebook.likebutton.FacebookLikeButton
style="#style/Widget.FacebookLikeButton"
app:pageUrl="http://url.to.like/page.html"
app:pageTitle="Title of page"
app:pageText="Short description of page"
app:pagePictureUrl="http://url.to.like/picture.jpg"
/>
This view will be drawn in your layout:
After clicking on it you will see the dialog with official Facebook 'Like' plugin.
Read more details.

construct predefined messages with properties to post on Facebook android

I want to post a pre-defined message on Facebook through my android application. I got everything to work except the 'properties' field. I want to post a message where it says:
More information: here
and when the user clicks on 'here', it should link to the page.
This is what I did:
Bundle params = new Bundle();
String s2 = "{'More information':{'text':'here', 'href':" + details + "}}";
params.putString("properties", s2);
where 'details' is the link to the page.
But it seems like facebook is not picking up this line. I successfully set up the caption, picture and other fields.
Any insights? Thanks!
This is by design, as far as I know, we do not support HTML in status updates. We will automatically create a link if you post a valid URL however, so I would suggest just pasting out the full link
".....More information: (www.yourURLhere.com)"
On Facebook, www.yourURLhere.com will be a clickable link.

Categories

Resources