Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 6 - Facebook sharing procedure fails with error "The proxied app is not already installed"

Though, there is such a question Facebook Error (7) iOS 6 it's already closed without any answer! While obtaining an access to user's facebook account I've got an error: error is: Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: The proxied app is not already installed." UserInfo=0xa260270 {NSLocalizedDescription=The Facebook server could not fulfill this access request: The proxied app is not already installed.}

I'm performing a request like this:

self.statusLabel.text = @"Waiting for authorization...";
if (self.accountStore == nil) {
    self.accountStore = [[ACAccountStore alloc] init];
}   
ACAccountType * facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

NSDictionary * dict = @{ACFacebookAppIdKey : FB_APP_ID, ACFacebookAudienceKey : ACFacebookAudienceEveryone};
[self.accountStore requestAccessToAccountsWithType:facebookAccountType options:dict completion:^(BOOL granted, NSError *error) {
    __block NSString * statusText = nil;
    if (granted) {
        statusText = @"Logged in";
        NSArray * accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
        self.facebookAccount = [accounts lastObject];
        NSLog(@"account is: %@", self.facebookAccount);
        self.statusLabel.text = statusText;
        [self postToFeed];
    }
    else {
        self.statusLabel.text = @"Login failed";
        NSLog(@"error is: %@", error);
    }
}];

What does this error means?

like image 546
Stas Avatar asked Oct 02 '12 07:10

Stas


2 Answers

I've solved this problem! It was because I do not pass permissions array! Though the ACAccountStore class states that this parameter is optional, it is not! enter image description here

More over the application could launch and ask for basic permissions(as it is implied)!

enter image description here

So, you must always pass a permissions array.

Here's also a description of error codes returned by account store:

typedef enum ACErrorCode {
   ACErrorUnknown = 1,
   ACErrorAccountMissingRequiredProperty,
   ACErrorAccountAuthenticationFailed,
   ACErrorAccountTypeInvalid,
   ACErrorAccountAlreadyExists,
   ACErrorAccountNotFound,
   ACErrorPermissionDenied,
   ACErrorAccessInfoInvalid
} ACErrorCode;

(I've got ACErrorPermissionDenied here)

like image 123
Stas Avatar answered Nov 08 '22 18:11

Stas


We had the same problem and after taking a closer look at the iOS facebook documentation ad

https://developers.facebook.com/docs/howtos/ios-6/

I noticed the following paragraph:

Note, to use iOS 6 native auth, apps need change the way they request permissions from users - apps must separate their requests for read and write permissions.

I must have read over that one several time but it contained the solution:

You have to do multiple request for access if you want to grant write (publish access). So now we first ask for permission 'email' to get read permission and then for 'publish_action' to be able to post to the timeline.

like image 11
Thomas Einwaller Avatar answered Nov 08 '22 19:11

Thomas Einwaller