4

I'm trying to send Facebook app requests using the Facebook iOS SDK using the built-in request dialog. The requests are sent without problems, but there are issues in the dialog which I'm getting, in the screenshot below:

What I'm getting when I show the requests dialog

As you can see, it is very different from the Request dialogs shown in the Facebook documentation section, and the request dialogs I see in other iOS apps:

Normal request dialog
(source: akamaihd.net)

  1. Cancel and Send buttons are broken (they work, but look very weird)
  2. It's not showing the request preview unless I set the 'to' parameter
  3. 'title' parameter is ignored

This is the code I'm using to display the requests dialog:

params[@"data"] = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:@{@"q" : NSInt(question.ID)} options:0 error:nil] encoding:NSUTF8StringEncoding];
    [FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession]
                                                  message:@"THIS IS A MESSAGE"
                                                    title:@"THIS IS A TITLE"
                                               parameters:params
                                                  handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                                      if (error) {
                                                          // Case A: Error launching the dialog or sending request.
                                                          NSLog(@"Error sending request.");
                                                      } else {
                                                          if (result == FBWebDialogResultDialogNotCompleted) {
                                                              // Case B: User clicked the "x" icon
                                                              NSLog(@"User canceled request.");
                                                          } else {
                                                              NSLog(@"Request Sent. %@", params);
                                                          }
                                                      }}];

I'm using Facebook iOS SDK 3.9.0. Anybody else experienced anything like this? Am I doing something wrong?

Any help is appreciated, thanks in advance.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Şafak Gezer
  • 3,928
  • 3
  • 47
  • 49

1 Answers1

1

What you're seeing is the new UI for the request dialog, so the buttons are part of the new design, and the message is no longer shown unless you explicitly specify the "to" parameter. The "to" parameter works for me (checked just now), how are you using it?

Ming Li
  • 15,672
  • 3
  • 37
  • 35
  • As you said, 'to' parameter works now, they didn't when the changes in the dialog first appeared. So you're saying that everyone using the 3.9.0 sees the dialog this way? I mean those cancel and send buttons look very glitchy to me. :/ Also I guess this means that they removed the 'title' param? ('message' does show when I set 'to' parameter, but no title still.) – Şafak Gezer Nov 21 '13 at 12:15
  • The UI changes have nothing to do with what version of the SDK you're using. They're controlled server side, and can change at any time. Facebook is always doing experiments with UI so you cannot say the buttons you see will be the same buttons/UI that your customers see. The title/message parameters are still accepted, whether they're shown or not in the dialog depends on the UI. – Ming Li Nov 21 '13 at 18:01
  • When you say depends on the UI, what exactly do you mean - I can't get any string I pass in as title to display, it always says App Requests? – 0xWood Jan 16 '14 at 11:47
  • I mean, it depends on the UI that the server decides to show. It may entirely ignore your parameters. – Ming Li Jan 16 '14 at 22:21