0

I use this code on my app to start facebook login :

    [FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES
                              completionHandler:^(FBSession *session,
                                                  FBSessionState status,
                                                  NSError *error) {
                                  NSLog(@"#####################");
                                  // session might now be open.
                                  [self sessionStateChanged:session state:status error:error];
                              }];

Safari start, but i got : enter image description here

I read that this error is related to the URL key in the plist file, everything looks OK

enter image description here

Here are some settings of the facebook app :

enter image description here

enter image description here

This is very strange. Of course, i double check the fb ID and bundle identifier ...

Any idea ?

Thanks

UPDATE

I got this error message only on the simulator. On real device, i got another one :

enter image description here

You can see that i changed the app id from last time. I just create another facebook app (and i changed the bundle id as well)

Of course i double check that app id and bundle Id are same from my ios app and in the facebook app settings ... so why does it say that the app id is invalid ?

4

3 回答 3

0

Attached my Facebook app settings for reference!

  • The Secure Canvas URL - Should have a valid link starting with https://
  • Canvas URL - Should have a valid link starting with http://

enter image description here

于 2013-09-06T12:45:27.710 回答
0

I don't think the issue is about the URL Scheme into the plist file.

In this related post, you can see the redirect_uri has to be set to a full URL when it's provided to redirect the user to after the login process is done. But I Think the redirect_uri has not to be set logging in by Facebook from an iOS app.

From my point of view, there are two ways to explore resolving this issue:

  1. Disable the FB option: embedded browser OAuth option
  2. Your plist file seems not to provide the FacebookDisplayName key which is now required. See the Facebook iOS SDK Getting Started page for this.
于 2013-09-06T14:17:59.407 回答
0
如果您使用的是 Facebook SDK,则无需费心进入
在 facebook 的应用程序管理页面上重定向 URI 的任何内容。只需设置一个
您的 iOS 应用程序的 URL 方案。
您的应用程序的 URL 方案应该是一个值“fbxxxxxxxxxxx”,其中 xxxxxxxxxxx 是
您在 Facebook 上标识的应用程序 ID。
要为您的 iOS 应用设置 URL 方案,请转到应用设置的信息选项卡
并添加 URL 类型。
于 2014-06-25T12:12:07.113 回答