Using presentShareDialogWithLink method of FBDialogs ignores description parameter ios - 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

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

iOS SDK, how to send a message to specific people?

Is it possible (using the iOS SDK ) to send a message to a pre-known list of people? I'm using this syntax, from (https://developers.facebook.com/docs/ios/share#message-dialog):
[FBDialogs presentMessageDialogWithLink:[NSURL URLWithString:#"https://developers.facebook.com/docs/ios/"]
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([NSString stringWithFormat:#"Error messaging link: %#", error.description]);
} else {
// Success
NSLog(#"result %#", results);
}
}];
From what I can tell, some usages of the share dialog support a to: parameter, but I don't see that here.
Edit: It really seems like the user picker dialog is not meant to be used in conjunction with the other messaging / sharing features of the SDK. This seems like a kind of absurd oversight.
Thanks!

iOS FBDialogs with one FBOpenGraphAction Uploading multiple photos

I'm trying to share multiple photos as open graph objects with one single action. Each photo object have a image url.
I can achieve share one photo object with one action per time, but I couldn't figure out how to share multiple photo objects at once. Any ideas?
the code I'm using is as follows:
id<FBGraphObject> photo =
[FBGraphObject openGraphObjectForPostWithType:#"photo"
title:#"photo title"
image:photoURL
url:photoURL
description:#""];
id<FBOpenGraphAction> shareAction = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[shareAction setObject:photo forKey:#"photo"];
[FBDialogs presentShareDialogWithOpenGraphAction:shareAction
actionType:#"share"
previewPropertyName:#"photo"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success!");
}
}];

Sharing link on Facebook does not show caption or description

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

Detect successful facebook post using FBDialogs

I'm trying to present the facebook share dialog from my iOS app.
This code opens the facebook app and shows the dialog:
FBShareDialogParams* params = [[FBShareDialogParams alloc] init];
params.link = urlToShare;
params.name = #"Test";
params.description = #"Description";
params.picture = [NSURL URLWithString:FB_IMG_URL];
BOOL canPresentShareDialog = [FBDialogs canPresentShareDialogWithParams:params];
if (canPresentShareDialog) {
[FBDialogs presentShareDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if (error) {
if ([FBErrorUtility shouldNotifyUserForError:error]) {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:#"Facebook-Error!" message:[FBErrorUtility userMessageForError:error] delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
} else {
NSLog(#"SUCCESS");
}
}];
}
In the completion handler I want to know if the user canceled the action. The results dictionary should tell me that. However I only get didComplete=YES in the dictionary but not a completionGesture. The NSError object is always nil.
The results dictionary is explained here: https://developers.facebook.com/ios/share-dialog/
So the problem is I can't tell if the post was successful or not.
Is something wrong with my code?
As stated in the doc, the "completionGesture" field is "only available if the user logged into your app".
So if the user has never used Facebook login with your app before, you will not get that field, and will only see the "didComplete" field.
If I am not wrong then you want to know if user is unable to post the data on facebook because of some error or because he pressed cancel button. If this is the case then use the code given below
[FBDialogs presentShareDialogWithParams:shareParams
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error publishing story.");
} else if (results[#"completionGesture"] && [results[#"completionGesture"] isEqualToString:#"cancel"]) {
NSLog(#"User canceled story publishing.");
} else {
NSLog(#"Story published.");
}
}];
its been taken from Facebook Developer Reference. Let me know if it helps. Thanks

Resources