8

I am trying to share/send a link to friends via the new Facebook Message Dialog which was implemented in v2.0.

I have been following the direction from the docs: https://developers.facebook.com/docs/ios/share#message-dialog-getting-started and this is what I have tried:

    [FBDialogs presentMessageDialogWithLink:[NSURL URLWithString:@"http://XXX.net/"] name:@"NAME" caption:@"CAPTION" description:@"DESCRIPTION" picture:nil 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([NSString stringWithFormat:@"Error messaging link: %@", error.des

cription]);
        } else {
            // Success
            NSLog(@"result %@", results);
        }
    }];

and this: (should be the same thing)

FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
    params.link = [NSURL URLWithString:@"http://xxx.net/"];
    params.name = @"NAME";
    params.caption = @"CAPTION";
    //params.picture = [NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/en/c/cd/Aller_Media_logo.png"];
    params.linkDescription = @"DESCRIPTION";

    [FBDialogs presentMessageDialogWithParams: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([NSString stringWithFormat:@"Error messaging link: %@", error.description]);
                                        } else {
                                            // Success
                                            NSLog(@"result %@", results);
                                        }
                                    }];

Both of these methods brings up my Facebook messenger app with the dialog pre-filled with my parameters. BUT when I have sent the message everything except for the link is GONE at the receiver's end.

From what I understand the user should not have to be logged in via the app to be able to send messages from the Facebook Message Dialog.

Does anyone have a clue what is going on here? Is this a Facebook Bug?

EDIT: This has been confirmed as a facebook-bug: https://developers.facebook.com/bugs/1547232035503916

PaperThick
  • 2,749
  • 4
  • 24
  • 42
  • 1
    I am also facing this issue and need a solution! In particular, in the send Message Dialog, I see the link, name and linkDescription but not caption (it is already lost). The receiver see's none of my custom info, with name and linkDescription having been overwritten by content that FB pulled from the link's page. – stonemonk May 26 '14 at 01:16
  • @stonemonk Exactly the same indeed. I have created a Facebook ticket about the issue but is seems like they are very busy at the moment. Either it is a documentation error or it is a but in their SDK. Please let me know if you find any solution to this – PaperThick May 26 '14 at 07:04
  • So, this hasn't been solved yet? I am struggling with the same issue. – Rhuantavan Sep 03 '14 at 07:21
  • @Rhuantavan I thought it had been resolved in the 3.15 patch but now it seems that more people are reportin the same issue in the ticket on facebook. Write a comment there and let the developers know that there is still an issue. – PaperThick Sep 03 '14 at 07:48

2 Answers2

3

Although this bug was fixed in June 2014, it is still possible to have similar problems with the latest Facebook example code. In the latest example "FBShareSample" and in the Facebook "Sharing in iOS" documentation they use the method

[FBDialogs presentShareDialogWithLink:....] 

which only uses the link from the parameters and none of the rest of the parameters (although the fallback example Feed Dialog actually does use all the parameters). In order to use all the parameters in the Share Dialog you need to use

[FBDialogs presentShareDialogWithParams:...]
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
nickt
  • 167
  • 5
0

I noticed that it depends on the URL that you are submitting. If the URL contains Facebook Open Graph then parameters from the URL Open Graph are shown and those parameters overwrite the ones you placed.

e.g. I am trying to share URL to my App Store. Every App Store link contains Facebook Open Graph so it doesn't work.

I think that Facebook recommends using publishing custom Open Graph stories in this case.

Adinp
  • 242
  • 4
  • 6