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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With