13

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.

Community
  • 1
  • 1
russwhitney
  • 143
  • 1
  • 5

2 Answers2

33

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

bundleID

lupatus
  • 4,208
  • 17
  • 19
  • I'll give that a try, but this is not an iOS app. Was yours? – russwhitney Sep 26 '12 at 20:06
  • I tried it, but it still has the same behavior and error message. – russwhitney Sep 26 '12 at 20:47
  • Sorry, I should read more carefully :) Mine is iOS app, but anyway error message is the same, so probably facebook is expecting some ID somewhere in settings.. Ill try to play with that on OS X – lupatus Sep 27 '12 at 01:14
  • Let me know what you find out. I'm curious, how much of that "Native iOS App" section did you have filled in? It's not clear for an OS X app how to fill in the application settings. Thanks for your help! – russwhitney Sep 27 '12 at 19:31
  • 1
    I made sample osx app and it works for me, [here](http://lupatus.com/dl/fbapp.png) you have screen shot from facebook settings (basic and permissions) and from my code. – lupatus Sep 27 '12 at 22:59
  • hi @lupatus, I followed all your above mentioned steps as in the latest screenshort you've provided. Im getting upto the alert asking permission to post on the wall on my behalf. After that, Im getting `The Facebook server could not fulfill this access request: Invalid application MY_APP_ID` Have any idea to fix it?. – Ananth Sep 28 '12 at 09:46
  • Sorry, but I haven't seen that error yet and I don't have any idea. Maybe open new question and put some more info in it (like some part of code)? – lupatus Sep 28 '12 at 12:25
  • Hi lupatus, I tried filling in the Facebook settings as you suggested but because I don't have an integrated Facebook web app I can't match your "App on Facebook" settings. And, of course, I still get the same error. Do you mind trying one more thing? Can you delete your "App on Facebook" part of your settings and see if you can still get access to the account from your OS X app? Thanks so much for your help. – russwhitney Sep 28 '12 at 17:41
  • sure, I will try. the page I have integrated there is fake - I just checked option 'Yes, I would like free web hosting on heroku' while creating app - then all that is set automatically and on heroku is created some basic web page. I did that cause facebook is complaining when no site URL is set (but maybe that doesn't matter, I will try and I'll give you feedback). – lupatus Sep 28 '12 at 21:27
  • Thats product name, by default it is sufix indeed, but it can be changed to something completely different and don't have to be a part of bundle identifier – lupatus Apr 16 '13 at 09:14
  • Thanks a million for this great answer. (I'm sending you a Bounty.) note that the problem only exhibits **if the iPhone is logged in to Facebook (Settings FB login)**. If the iPhone is NOT logged in (Settings FB login), you can "get away" with NOT entering any bundleID on the developers.facebook.com page. Again -THANKS. – Fattie Jan 16 '14 at 10:05
3

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:

Facebook Bundle ID

Şafak Gezer
  • 3,928
  • 3
  • 47
  • 49