I have an option in my game for users to post an achievement to their wall. If they are logged in, i.e. their token is still active, it works fine. However, if they need to renew their token, the app exits and the Facebook authentication page loads for a second before returning to the app (they only need to click OK on the authentication page if they have actively logged out, otherwise it happens automatically).
The problem is that if this happens, when the game returns, the request fails. But since they're now logged in, if they were to press the 'share to wall' button a second time, it works fine. The error message output by the failed request it:
DIDLOGIN
2012-02-21 12:01:33.502[18153:15803] Response received
2012-02-21 12:01:33.502[18153:15803] Request did load raw response
2012-02-21 12:01:33.502[18153:15803] Request failed, error: Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x9992010 {error=<CFBasicHash 0x99785e0 [0x2093b38]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0x9963370 [0x2093b38]>{contents = "type"} = <CFString 0x99952a0 [0x2093b38]>{contents = "OAuthException"}
3 : <CFString 0x99631e0 [0x2093b38]>{contents = "message"} = <CFString 0x997e5b0 [0x2093b38]>{contents = "An active access token must be used to query information about the current user."}
6 : <CFString 0x998c370 [0x2093b38]>{contents = "code"} = 2500
}
}
I'm not sure why I'm getting an OAuthException when I've just successfully authorised it?
Thanks for any help!
when you set the dictionary of params that you send it to the facebook .. pass the acces token also ,, like this
ReplyDeleteNSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"someText",
@"message",
[fb accessToken],
@"access_token",nil];