简体   繁体   中英

Problems in App Request Dialog (Facebook iOS SDK)

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:

当我显示请求对话框时,我得到了什么

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:

正常请求对话框
(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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM