Open oodavid opened 9 years ago
Are you sure the auth.statusChange event doesn't fire? I am using that internally without issue. The 2nd argument to getLoginStatus isn't supported currently. I somehow missed that part of the interface.
Side note: those bind calls are not necessary. This code looks suspicious:
FB.getLoginStatus(bind(this, function(response){
this.dealWithStatusAndAuth(response); // Might be caught by the event handlers, but to be sure
}), true); // Force a round-trip
You never assign anything to this.dealWithStatusAndAuth
before you call it.
I'll run a test shortly :)
Right, just ran another test on iOS/XCode - I can confirm dealWithStatusAndAuth doesn't log anything to the console. Unless there's a circumstance where the code is run before the logger can catch it?
_PS_ - I've updated my initial post without the strange bind() scoping, it was piecemeal code that I lifted out of a context where it made sense!
Are you on the 2.0 release tag? It looks like those events should be firing regardless of whether you pass the status flag.
- (void) onSessionStateChanged:(FBSession *)session state:(FBSessionState) state error:(NSError *)error {
NSLOG(@"{facebook} onSessionStateChanged");
switch (state) {
case FBSessionStateOpen:
case FBSessionStateOpenTokenExtended:
if (!error) {
NSDictionary * res = [self authResponse];
[[PluginManager get]
dispatchEvent:@"auth.authResponseChanged"
forPlugin:self
withData:res];
[[PluginManager get]
dispatchEvent:@"auth.statusChange"
forPlugin:self
withData:res];
// ...
Self explanatory code:
Workaround: Manually call getLoginStatus after initialising