Post app icon through facebook feed dialogue on fb wall - android

I am using facebook feed dialogue to post on fb wall.
For this i am using the following bundle.
Bundle params = new Bundle();
params.putString("name", appName);
params.putString("caption", "Any Caption");
params.putString("description", "Any description");
params.putString("link", "Any link);// App Link
params.putString("picture", link);//Pic Link
Now I need to pass an app icon which selected from my custom listview instead of above "picture". How can I do this? Any help...

The "picture" value must be an URL. So if you have the corresponding icons on the web somewhere, you can link to those instead. If you're dynamically generating the icons, then no, you can't do it.

Related

How do you add a hyperlink (i.e. "properties") to a Facebook Feed Dialog in Android?

My Android app calls the Facebook Feed dialog and customizes it like this:
Bundle feedDialogParameters = new Bundle();
feedDialogParameters.putString("name", "My Name");
feedDialogParameters.putString("link", "My Link");
feedDialogParameters.putString("picture", "My Picture");
feedDialogParameters.putString("caption", "My Caption");
feedDialogParameters.putString("description", "My Description");
facebook.dialog(getActivity(), "feed", feedDialogParameters, new PostDialogListener());
This works great, but now I would like to add some text and a hyperlink to the dialog. I know this is possible through the JavaScript Facebook API, by including a "properties" parameter, but I have been unable to find the equivalent for Android. How does one do this?
You can try this maybe, to see if helps: parameters.putString("link", "http://www.google.com");

Picture is not posted on facebook

hey I'm using this code technique to post on my fb wall
// parameters.putString("description", "Muslim Baby Names");
parameters.putString("picture","http://img208.imageshack.us/img208/4834/pic1qu.png");
it does make a post but picture odes not get posted.
Kindly tell me how should I do it
Check out our example app that uses the Android SDK, Hackbook. Here is the relevant code that uploads a photo to a user's wall from a remote URL.
For your example, this is how you would do it:
Bundle params = new Bundle();
params.putString("url", "http://img208.imageshack.us/img208/4834/pic1qu.png");
params.putString("caption", "Muslim Baby Names");
mAsyncRunner.request("me/photos", params, "POST");
Let me know if that helps!

how to pass my image to facebook feed dialog android

I am using following code to post on a user's wall.
Bundle params = new Bundle();
params.putString("message", facebookMessage);
params.putString("link", ComLabelConstants.FACEBOOK_LINK);
params.putString("name", linkname);
params.putString("picture", "http://some link");
params.putString("caption", ComLabelConstants.FACEBOOK_LINK_CAPTION);
params.putString("description", "This is description");
// displaying facebook dialogs
mFacebook.dialog(FbookAlertBoxActivity.this, "feed", params,new SampleDialogListener(this, mAsyncRunner));
Now, I want to use my own image in drawable folder to post on user's wall and not from any link. Can we do that? anyone have solution for this.
You can't publish an image directly to a feed like you are asking - you can only pass a link to the image.
The only solution is to upload the image to a web server and then pass the URL of the image as the picture parameter.

Post on user's friends facebook wall through android application

I am developing an Android application in which the user logs in using its facebook id.
I can get all the information about the user and i even get its friends list with following methods
facebookClient.request("me")
facebookClient.request("me/friends")
My query is that i want to give flexibility to the user to invite its facebook friends.
I dont know what extra stuff is to be done here.
Any help will be appreciated.
Check out:
How to post on facebook wall using Facebook android SDK, without opening dialog box
and
How to post message on facebook wall using Facebook android SDK integrate android app
Here's a small example that will post to a friend's wall (or if userId is null then to the currently logged in user's wall):
protected void postToWall(String userId)
{
Bundle params = new Bundle();
params.putString("message", _messageInput.getText().toString());
params.putString("caption", "{*actor*} just posted a secret message.");
params.putString("description", "A secret message is waiting for you. Click the link to decode it.");
params.putString("name", "A Secret Message For You");
params.putString("picture", "http://www.kxminteractive.com/Content/images/app_logos/secretMessage.png");
params.putString("link", "http://www.kxminteractive.com/decrypt/" + _lookupKey);
asyncRunner.request(((userId == null) ? "me" : userId) + "/feed", params, "POST", new WallPostRequestListener());
}
use this to send message on friends wall of id(uid):
Bundle params = new Bundle();
params.putString("message", "hello ...");
Utility.mAsyncRunner.request(uid+"/feed", params, "POST", new FriendRequestListener(), null);

How to set an icon and add an action in a facebook post using facebook api?

I'm using facebook-android-sdk to post a message on facebook using the bundle shown below.
The message is displayed correctly, but the icon is not shown, and I can't find a way to get something like the image below.
Is this the correct way to set an icon?
How ca I add in the bundle something like "Get Spotify" as seen in the image?
Thanks.
Bundle params = new Bundle();
params.putString("message", "icon please");
params.putString("link", "http://www.digital-farm.org");
params.putString("name", "whip'em");
params.putString("description", "description");
params.putString("picture", "http://lib.store.yahoo.net/lib/yhst-17155638221985/img-twitter.gif"); //used for testing
params.putString("icon", "http://photos-c.ak.fbcdn.net/photos-ak-snc1/v27562/74/174829003346/app_2_174829003346_2760.gif"); //used for testing
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
mAsyncRunner.request("me/feed", params, "POST", new PostRequestListener(), null);
Actually that icon you show in your screen shot is probably the Facebook application's icon. It's set within the Facebook application's configuration/settings. When you post via your Facebook application, the icon should appear automagically. See screen shot below for example.
Assuming you're using the Facebook SDK for Android, when you instantiate your Facebook object, you pass your Facebook application's ID as parameter into the constructor. That's how the wall posting is associated with your Facebook application.

Categories

Resources