Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using Facebook iOS SDK 2, how do I like a page? - "Application must be on whitelist"

How do I "like" a page using the new Facebook iOS SDK? (http://github.com/facebook/facebook-ios-sdk)

I'm currently attempting to do it with:

NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[_facebook accessToken],@"access_token",nil];
[_facebook requestWithGraphPath:@"cocacola/likes" andParams:dict andHttpMethod:@"POST" andDelegate:self];

This doesn't work. When I NSLog([error description]); I get:

Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x6a50160 {error=<CFBasicHash 0x6a4fd40 [0x250b380]>{type = mutable dict, count = 2,
entries =>
    2 : <CFString 0x6a4fc80 [0x250b380]>{contents = "type"} = <CFString 0x6a50000 [0x250b380]>{contents = "OAuthException"}
    3 : <CFString 0x6a500e0 [0x250b380]>{contents = "message"} = <CFString 0x6a50080 [0x250b380]>{contents = "(#3) Application must be on whitelist"}
}
}

I have added my IP (the IP address my computer, as I'm running from the simulator, gets when visiting www.whatismyip.com ) to the whitelist in my Facebook application's white list under advanced settings.

Thanks!
Tristan

like image 295
WoodenKitty Avatar asked Sep 28 '10 04:09

WoodenKitty


2 Answers

It looks like it's a well known, but unconfirmed, bug: http://bugs.developers.facebook.net/show_bug.cgi?id=10714.

It may help if you voted for the bug in Facebook's bug tracker.

like image 180
Kris Markel Avatar answered Oct 12 '22 08:10

Kris Markel


Partial solutions have been suggested, though the user experience is only great if the user is already logged in to FB -- this may be likely for many but not all users, so it remains an imperfect approach.

http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html

like image 43
Derek Pearcy Avatar answered Oct 12 '22 08:10

Derek Pearcy