I have a wierd problem with integrating a basic "post to facebook feed" in my app.
The first time after you install the app and use the post to wall button everything works great.
But after that first run the small icon next to the " via APPNAME" is missing when i use the "post to wall" button, there is just a missing picture questionmark there instead.
Here is the facebook code(tried to keep it simple as i dont require any other facebook functionality in my app):
if (facebook == null)
facebook = new Facebook("<MY_APP_ID>");
//Creating the bumdle parameters with link, picture, name, caption and description
facebook.dialog(this, "feed", parameters, new DialogListener(){});
I have run into this in the EMU, but actually on facebook the APP ICON actually shows up fine.
I am testing to see if this is a device issue or an EMU issue, but you can rest assured that it posts to FB properly.
Related
I am a newbie developer on Android and Facebook SDK. I want to share my long description text content to facebook via Facebook SDK 4.0 on Android.
I have a ShareActionProvider on my App and it's working fine with my ShareDialog method. But I have a long description in my app and I want to share this description on Facebook. I imported and configured Facebook Android SDK and It's working fine with this method;
if (ShareDialog.canShow(ShareLinkContent.class)) {
Spanned faceKonu= Html.fromHtml(mShareKonu);
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle(konu)
.setContentDescription(faceKonu.toString())
.setContentUrl(Uri.parse(getString(R.string.share_onfacebook_url)))
.setImageUrl(Uri.parse(getString(R.string.share_onfacebook_image_url)))
.build();
shareDialog.show(linkContent);
}
But this method shows my description text too short on wall or somewhere in facebook.
This is my description screen : http://i.imgur.com/56c2vIw.png
This is the facebook api when I tap the share on facebook on ShareActionProvider menu : http://i.imgur.com/LpvH9FT.png
How can I post all texts on Facebook like that ?
Thank you !
I have same problem with Android Facebook SDK 4.0. But I found this problem. I use my phone in Turkish. But When I change my phone language to English, problem is solved. That's like a joke. I think it's a bug for now. I hope they might solve this problem.
There is no way for you to influence the length of the preview Facebook shows for the link you shared. Keep the description brief, for everything else people can click on the link the user shared and read your full message.
As noted by Ming Li in the comments, don't publish this text via any other method as all content in the message field has to be user-generated and typed by the user character by character.
Predefined text which is not allowed by facebook is supposed to be everything but the text which is typed character by character. This possibly means that we should use open graph stories instead
I am trying to integrate the Facebook with my Android App. I am using ShareDialog for sharing a short message using the below statements. The variable "message" the short information on game statistics. When I tried to share this particular message I am getting only the image and the Facebook app name. So finally I could see the image with the link and the Facebook app name but not with the values from (.setName / .setDescription). What I am supposed to do to get those details as well.
return new FacebookDialog.ShareDialogBuilder(this)
.setPicture("http://i61.tinypic.com/jjbslv.png")
.setName("Memory Game" + message)
.setDescription(message)
.setLink("https://play.google.com/store/apps/details?id=kids.animals.fruits.objects.brain.puzzle.memory.game.free")
;
Answer Source:
Android Facebook SDK FacebookDialog.shareDialogBuilder doesn't show my description
Replacing playstore's like with website's link solved it for me too.
How can i post message along with Picture using Facebook SDK 3.0 on Android,
The link -> can post small pic with link and all other information.
http://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/
What i want, is only to post Pic on wall with message, not a link with description ?
I want grab screen shot of my current Android screen that i did and saved it into SD card, i need to post it with message on custom button click.
How can i do this with Facebook SDK 3.0 for android ?
You can use the Graph API to post photos to a user's wall.
See the reference page for more details.
In the Facebook SDK, you would use the Request class to make Graph API calls.
You can use the newUploadPhotoRequest method to add a photo.
If you want to add a description as well, try setting the "message" parameter:
Request photoRequest = Request.newUploadPhotoRequest(...);
Bundle params = photoRequest.getParameters();
params.putString("message", "description goes here");
photoRequest.executeAsync();
Facebook changed this implementation for there version 2 Graph API requests, they recommend a Custom Story instead of posting (if you have your own content to put on the wall of the facebook user beside his comment, or even without his comment)
documentation goes here :
https://developers.facebook.com/docs/android/open-graph?locale=en_GB
just an error in the documentation, the facebook Open Graph objects are refered to by a colon, and not a dot, for example
they mention an open graph Object named "book" in a work space named "books" that way
"books.book"
the correct way is
"books:book"
and after you finish implementation you will need to review your application to facebook, which it's documentation goes here as well
https://developers.facebook.com/docs/apps/review?locale=en_GB
i really hate facebook documentation, it sucks
I have spent quite much time trying to implement Facebook share with no success. I have tried various implementations and read quite a few Q&As related to similar problems I had occurred.
I have as much as simple Facebook Example does. What I want is to set description or at least message of the feed dialog. This is what I have added to example's code:
Bundle parameters = new Bundle();
parameters.putString("caption", "1000vaikai Caption...");
parameters.putString("description", "This is a description"); // the message to post to the wall
parameters.putString("user_message_prompt", "This is message prompt");
parameters.putString("user_message", "MEEEESAGE");
mFacebook.dialog(Example.this, "feed", parameters,
new SampleDialogListener());
But it has no effect. There is nothing preset, just a plain feed dialog. Here it says dialog methods has key-value parameters but I can't find a list of them. As you can see, I tried using parameters from the feed URL but it doesn't work.
Anyone got it working properly?
EDIT
I hacked Facebook SDK and it seems to generate proper URL (https://m.facebook.com/dialog/feed + my parameters + ones taken from Facebook SDK itself). That means it DOES use same parameters as the ones listed in documentation about feed dialog page. But it still doesn't work. These parameters are being set:
user_message
redirect_uri
description
app_id
display
caption
access_token
user_message_prompt
Only app_id (I can see my app name), access_token (share actually works) and redirect_uri (it redirects back to mobile app) seem to have the effect
So I have figured out that you must provide either a link or picture. If not - it simply ignores all the over parameters.
I want to upload a foto from my android app to a facebook fan page using the facebook API.
When i look in the hackbook android example app (link). the code looks as following to a upload photo:
Bundle params = new params.putString("url",
"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg"); params.putString("caption",
"FbAPIs Sample App photo upload");
Utility.mAsyncRunner.request("me/photos", params,
"POST", new PhotoUploadListener(), null);
This code works, it posts the photo on my own facebook page. But i don't want the photo to be posted on my page but on a fan page.
As explained in the facebook documentation 'me' could be changed with a facebook User_ID. I tried changing the "me/photo" in "[fanpagename]/photo" or "[fanpageID]/photo", but that did not work. when i used the username i got an error, when i used the ID it post the photo on my own page. In the graphAPI photo documentation (link) no example or explanation is givin on how to upload a foto on fan page.
also the
params.putString("to", [fbid]);
does not work.
Any suggestions?
I have been busy with this research for three full days and did not find the answer for my problem. But i think i have an explanation for it.
if a user posts a photo to friend/fan_page with the official android FB app it uses a "feed" with a picture(url-link). The user can't see on his own wall that he actually shared or posted a picture on the friend/fan_page. (for example: "Bob - posted a photo on CocaCola")
This is probably the reason why the function is disabled because developers could use this to send photo's to all kinds of friends/fan_pages without the user being aware of it.
I came to this hypotheses because i found a sort of work around. First upload the photo to users own album. get the URL of that photo and then post a "feed" on the friend/fan_page with a picture(url-lnk). Facebook then gave this error: "FBCDN image is not allowed in stream" in other words, you can't use photos that are on FB website domain to link to. So I think there is quite a bug/lazyness in the facebook developement departmet :P which is a pity because it is a nice socialnetworking function for mobile apps.
You are on the right track, but to publish photos to a Page you will need the publish_stream and manage_pages permissions, and the Page Access Token to prove you have them. You can read more about this here:
http://developers.facebook.com/docs/reference/api/page/#photos
http://developers.facebook.com/docs/reference/api/page/#page_access_tokens
Some example code (using the PHP SDK, but the logic should be the same in any language) is here: https://stackoverflow.com/a/7222078/164439
Update:
If you want to post to the Page's Wall/Feed (without being a Page Admin), you can do that without the Manage Pages permission and the Access Token stuff.
But it's different than publishing a Photo object to the Page's Photos collection, which is what I thought you asked. You actually want to do a regular Post to the Page, with a Picture attachment.
Here are some resources to do this:
Facebook Post API: http://developers.facebook.com/docs/reference/api/post/
http://facebook.stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile
http://facebook.stackoverflow.com/questions/5756474/post-to-facebook-page-wall
Using Facebook Graph to simply post a wall message with just javascript
Good luck!