Mac OS X Facebook login failed - no stored remote_app_id for app

大城市里の小女人 提交于 2019-12-31 20:40:09

问题


I am trying to use the new ACAccountStore capabilities on Mac OS X 10.8 to login via Facebook but I get an error:

The Facebook server could not fulfill this access request: no stored remote_app_id for app

When the code executes the requestAccessToAccountsWithType message it does prompt me for access to Facebook (which I allow) and I do have Facebook credentials stored in my Settings. I also have another code path for legacy versions of OS X which logs into Facebook using the WebView control. It does work with the same APP_ID. So I should have the app correctly setup in the Facebook developer settings. In there some other configuration that I'm missing? I search on the Internet for "remote_app_id" and I get the empty set.

    ACAccountStore *account = [[ACAccountStore alloc] init];
    ACAccountType *accountType = [account accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: FB_APP_ID, ACFacebookAppIdKey, [NSArray arrayWithObjects:@"email", nil], ACFacebookPermissionsKey, ACFacebookAudienceFriends, ACFacebookAudienceKey, nil];

    [account requestAccessToAccountsWithType:accountType options:options completion:^(BOOL granted, NSError *error) {
        if (granted) {
            NSArray *accountList = [account accountsWithAccountType:accountType];

            for (ACAccount *thisAccount in accountList) {
                NSLog(@"Found account: %@", [thisAccount accountDescription]);
            }
        }
        else {
            NSLog(@"Not granted because: %@", [error localizedDescription]);
        }
    }];

useful note for iPhone devs: to exhibit this problem 100%:

Regarding the same issue on the iPhone (this page is the main google landing for that): The issue is this: on the iPhone, go to Settings, left menu Facebook, then on the right username/password - login to Facebook. So that's the "Settings Facebook Login". If the iPhone is in fact logged in to FB on the "Settings Facebook Login" then the problem will exhibit. If you explicitly log out on "Settings Facebook Login" (and indeed, perhaps uninstall the FacebookApp), the problem will not exhibit.


回答1:


Looks like you have to set bundle ID of your iOS/OSX app in Facebook app settings (that fixed thing in my case)




回答2:


Set the bundle ID on the Facebook web interface, and it will get updated right away.

Its position on the updated developer UI is below:



来源:https://stackoverflow.com/questions/12555799/mac-os-x-facebook-login-failed-no-stored-remote-app-id-for-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!