Android facebook PhotoShareDialogBuilder error - facebook

I'm trying to use PhotoShareDialogBuilder to upload photos to facebook and I'm getting an error from the facebook app when uploading is finished (The upload progress bar reaches 100% just before it errors).
The error message is:
"Your photo could not be uploaded."
"We're sorry, this upload can't be completed."
Steps I've taken to set the app up as per the documentation:
Adding the facebook application to my solution
Setting up the application on https://developers.facebook.com/
Creating the app key/secret and dev hashkey and adding the app key to the application
Adding a com.facebook.NativeAppCallContentProvider to the androidmaniest.xml with the app key correctly attached
Adding a UiLifecycleHelper and overriding all the activity functions
Adding the following code to share the image in question:
if (FacebookDialog.canPresentShareDialog(context, FacebookDialog.ShareDialogFeature.PHOTOS) && FacebookDialog.canPresentShareDialog(context, FacebookDialog.ShareDialogFeature.SHARE_DIALOG)) {
//If you can find the facebook app, link to it
FacebookDialog shareDialog = new FacebookDialog.PhotoShareDialogBuilder(getActivity())
.addPhotos(Arrays.asList(renderedImage))
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
}
The "renderedImage" is a bitmap array with size of 1, as addPhotos must be passed a collection instead of a single image.
Extra info:
I have used ShareDialogueBuilder to sucessfully post a text status to my facebook account, and link to a website, it's only uploading photos that is broken
I tried multiple different sizes of image, and uploaded one of them to facebook manually from the phone to be sure it worked
On the upload dialogue on the facebook app, the image preview displays correctly
First stackexchange post, hope my formatting is ok!

If you're getting this problem check your dev hash key
I'd previously got sharing links working but in between switching to pictures the hash key got overwritten or corrupted, and was causing my problems
If you're unsure, try just sharing a link, as the photo uploader does not tell you about the hash key error!

Related

Facebook SDK - Open Graph - Share Dialog post button greyed out - error code 102

I'm following the tutorial for Publishing using the Share Dialog on the Custom Stories in iOS section.
https://developers.facebook.com/docs/ios/open-graph
When I want it too, it switches to the Facebook App, the Graph Object is presented to the user (image, title etc) for a few seconds and then disappears and Post button greys out. If I tap the Post button before it greys out, I get an error message logged:
Error publishing story: Error Domain=com.facebook.Facebook.platform Code=102
"The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)"
UserInfo=0x16d48640 {error_code=102, app_id=1435110413425124,
error_message=An error occurred during publishing.}
FYI, the standard share dialogue presentShareDialogWithLink:handler: is working fine and letting me post - it's just when I present one with a Graph Object attached to it.
I would post sample code, but it'm using the same code that's in the tutorial above. Besides, I'm pretty sure this is to do with settings in the App Dashboard, not the code I'm writing.
Per this question on Stack Overflow Facebook SDK - iOS - Fail to share URL (Error 102), I've confirmed that:
My App's Settings are set correctly in App Dashboard (including iPhone Store ID and Bundle ID)
By info.plist file is configured correctly.
This question facebook error code 102 with sdk 3.6 suggested using a real Facebook user who was an administrator of the app. I tried that, but the problem still occurred for me.
I also tried it with the App published, and with it unpublished and there was no difference.
I'm wondering if anyone else has any ideas for things I haven't checked yet?
I'm a numpty.
Despite the fact I said I'd checked the settings were correct in App Dashboard, I had misspelt the Namepsace.
If your Facebook app status is "development and unavailable to the public" will caused same result.
You may want to change it to public under "App Review" on the Facebook app menu. Or you need to login Facebook as role "Administrators", "Developers" or "Testers"

Facebook create Application not showing icon when posting image or video. it showing only when post text

I create one application on developer.facebook.com. and add 3 image 16,75 and 128. the application icon shows when i post text. but it doesnt show when i post video or image. should i make any changes in setting of the app on developer.facebook.com.
For example. in path.
in my application when posting text. the app icon appear.
but when posting image or video. the app icon disappear.
Thanks for help. i have done r&d on this and i got Facebook bug so is it right?: http://developers.facebook.com/bugs/447623711966656?browse=search_50bfaaaf247045772567103
This is by design and isn't related to your application settings. Facebook display videos and photos uploaded by applications in different ways to status updates and sharing using the share dialog.

Share generated personal image to FB with Opengraph

I'm stuck with this problem for several weeks now and will try to give a short and detailed explanation below:
Situation
Users visiting the websites and has the option to generate an image with the GD-library. So every users generated a personal image. Simple... until now. After generating the image, the user gets the option to share this image to Facebook. This is done via the OpenGraph protocol.
What's working (Yeah!)
Generating the image is working perfectly fine. Sharing something to Facebook is working also.
Problem
Although the following code is used on sharing the image (fbrefresh=CAN_BE_ANYTHING). FB stills pulls an old image. Sometimes this is a really old image, sometimes it's a more current generated image. But never the just generated image.
And now?
As said I've already tried the fbrefresh=CAN_BE_ANYTHING. Also in de debug tool the right image isn't showing up, but this is probably because the generated image has an unique ID generated from the users cookie. So this id is only usable when the users clicks on generate and after that shares the generated image.
Is there any example on the internet that uses the same sort of strategy and is working? I've searched half the internet and didn't found it yet it's becoming more and more frustrating.
After generating the image, the user gets the option to share this image to Facebook. This is done via the OpenGraph protocol.
What exactly do you mean by the latter? Are you just uploading that image to the user’s wall/one of their albums, or are you publishing an Open Graph object with a user-generated photo attached? (Btw., user-generated photo is meant literally for OG actions – you should only do it with photos that the user has taken using f.e. their mobile phone camera while they where undertaking the action. I doubt if a GDlib-generated image fits into that description.)
Although the following code is used on sharing the image (fbrefresh=CAN_BE_ANYTHING). FB stills pulls an old image.
And by “pull” you mean what exactly, again? Do you upload the photo as an HTTP POST upload, do you upload it by URL, did you specify it as og:image for an OG object, or do you pass it as user-generated photo while publishing an action?
Now, usually the easiest way for resources referenced by a URL to get properly refreshed by the requesting client, is to attach a different value to the query string/as a GET parameter – f.e. the current unix timestamp: …/image.php?1984372634 or …/image.php?foo=bar&forcerefresh=1984372634
Since this value changes every second, it makes each of those URLs a different URL, and the requesting client absolutely has no choice but to request that resource, because he can not have it in its cache already.

Facebook Image URL is invalid (Graph API)

I am developing a Facebook game. In that the 10 opponent picture is displayed. I had saved these profile images in the database once the user had registered.
I am using PHP to echo the image, but the problem is some pictures are being displayed and others are giving me a ‘404’ / ‘400’ or ‘Invalid URL ‘ not found error.
Example: ( These images earlier used to be displayed but not anymore)
http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash3/522851_116822898455075_142765921_q.jpg
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/199347_134645999940053_5814468_q.jpg.
How can I fix this problem? Or find some alternative so that the
broken link of these images is not displayed.
I am having the user ID
of these users, Can I somehow generate new picture if these picture links
are detected as broken?
Is it advisable to hotlink the Picture URLs ? I don't want this
problem to occur again?
I would appreciate if some one could help me.
You can use this url to fetch profile images of any user using his/her FB user id's
https://graph.facebook.com/<fb USER ID>/picture?type=large

I can't see metada of my Facebook canvas application

First of all I can't post any specific info about project because it has to be secret till going live.
I'm struggling with my Facebook canvas application. I set up everything correctly, and added App Namespace, lets say 'some_namespace'.
So my app would be accessible under this URL: http://apps.facebook.com/some_namespace/
When I check this URL in debugger (http://developers.facebook.com/tools/debug) it works perfectly! I see all the metadata (image, title, description and others)
But see attached images - I can't see anything there:/
Can anyone help?
I think you need to lint the url of your app page, not the facebook url. Do you get any different results from that?
First one started to work when I generated second using activity, so probably fb cache issue, or lack of data several hours ago
Second one started to work after I specified App info details (with 180px image) on app profile page.