Sharing link on Facebook does not show caption or description - ios

I have an app that shares links to facebook. This link comes with a description and a caption. The problem I have is that the caption and description does not show up on facebook, sometimes a totally different caption is shown that I think is the site (link) description.
using facebookSDK this is how I share:
if ([FBDialogs canPresentShareDialogWithParams:params])
{
[FBDialogs presentShareDialogWithLink:params.link
name:params.name
caption:params.caption
description:params.description
picture:params.picture
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error)
{
if(error)
{
NSLog([NSString stringWithFormat:#"Error publishing story: %#", error.description]);
} else {
// Success
NSLog(#"result %#", results);
}
}];
}
I have another app that uses the same exact code and the caption shows just fine. I don't get it LOL help please

Related

iOS Facebook SDK Native Sharing

I have integrated Facebook Sharing of a link with a description, caption, etc via the Native Facebook App (if it is installed) using the code:
FBLinkShareParams *params = [[FBLinkShareParams alloc] initWithLink:[NSURL URLWithString:#"https://abcde.com"]
name:#"demo"
caption:#"demo"
description:#"demo"
picture:nil];
//Present share dialog
[FBDialogs presentShareDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
// Success
NSLog(#"result %#", results);
}
}];
When this method runs, and the native facebook app is installed, I get an option to share a post that has caption, link and description. When I click share and I go on FB to check it, it appears to only have the link?
Can someone suggest a possible fix?
Most likely it is due to newest Facebook sharing policy 2.3

Facebook iOS SDK , share an image with a caption using ShareDialog (not GraphAPI)

I'm using following code to share a picture to Facebook using ShareDialog. However I'm unable to set a caption to this. params does not have a property for a caption.
FBPhotoParams *params = [[FBPhotoParams alloc] init];
params.photos = #[image]; // this is an UIImage instance.
[FBDialogs presentShareDialogWithPhotoParams:params
clientState:nil
handler:^(FBAppCall *call,
NSDictionary *results,
NSError *error) {
if (error) {
NSLog(#"Error: %#",
error.description);
} else {
NSLog(#"Success!");
}
}];
However there's a different method to share a status update with a picture, but this methods allows to share an image as a web link.
presentMessageDialogWithLink:name:caption:description:picture:clientState:handler:
I want to share a local UIImage just like in my first approach, with a caption. Is this possible?
There's no support for captions via the photo share dialog. The user must type in the caption/message themselves.

Using presentShareDialogWithLink method of FBDialogs ignores description parameter ios

I am using FBDialogs to share on facebook where I am sharing picture, name and description.
Below is my code used for sharing:-
[FBDialogs presentShareDialogWithLink:params.link
name:params.name
caption:nil
description:[NSString stringWithFormat:#"OMG I’m in LOVE with a puppy named %#.Come and say hi %#",sPuppyName , ITUNES_STORE_LINK]
picture:params.picture
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
// Success
NSLog(#"result %#", results);
NSLog(#"result obtained %#",[results valueForKey:#"completionGesture"]);
if([[results valueForKey:#"completionGesture"] isEqualToString:#"cancel"]){
[[NSNotificationCenter defaultCenter] postNotificationName:#"facebookDidSharingCancel" object:self userInfo:nil];
}
else if([[results valueForKey:#"completionGesture"] isEqualToString:#"post"])
{
[[NSNotificationCenter defaultCenter] postNotificationName:#"facebookDidLogin" object:self userInfo:nil];
}
}
}];
I am able to see description on share dialog while sharing but on Facebook site I am not able to see description.
Searched a lot but cant find any way so please anybody help me.
Thanks in advance

Facebook share dialog auto returns to app

I'm trying to create a share button which share a post on Facebook. I've found this code below under Dialogs and UI controls on the Facebook developer page. It works just fine. The only problem is that after a few seconds on the Facebook post page it automatically goes back to the app without me clicking on anything. The below code is everything related to Facebook I've added, beside the plist Facebook app info.
How come it automatically returns to the app?
Code :
id<FBGraphObject> mealObject =
[FBGraphObject openGraphObjectForPostWithType:#"cooking-app:meal"
title:#"Lamb Vindaloo"
image:#"https://example.com/cooking-app/images/Lamb-Vindaloo.png"
url:#"https://example.com/cooking-app/meal/Lamb-Vindaloo.html"
description:#"Spicy curry of lamb and potatoes"];
id<FBOpenGraphAction> cookAction = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[cookAction setObject:mealObject forKey:#"meal"];
[FBDialogs presentShareDialogWithOpenGraphAction:cookAction
actionType:#"cooking-app:cook"
previewPropertyName:#"meal"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success!");
}
}];

Posting an action with user generated photo on ios share dialog

What i was trying to do was to publish a camera generated photo into facebook with an open graph action.
here is the code i used:
UIImage *imageToShare = [EXPOINNOVAImageCombiner mergeImages:photo TopImage:tbot];
//Custom UIImage to be shared on facebook
NSArray* images = #[#{#"url": imageToShare, #"user_generated" : #"true" }];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:#"http://emaginelab.com/FBAction/fbtbot.html" forKey:#"tbot"];
[action setObject:images forKey:#"image"];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:#"expoinnovaapp:took_a_photo_with"
previewPropertyName:#"tbot"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success!");
}
}];
When i set the user_generated flag to false, the post works, but if its true facebook tries to post it, but falls back to the app before the upload finishes.
I already registered my app in facebook, and added the user generated photos capability so, in theory, the app should post a larger version of the photo in the user timeline.
btw the image is 640x640
what am i doing wrong here?
thanks in advance

Resources