davejohnson/phonegap-plugin-facebook-connect — Issue #73: Crash on logout - using PhoneGap 1.3.0 on iOS - XCode (Fixed Maybe?)
Author: rjaviervega
Created: 2011-12-24 04:43:09+00:00
State: open

I have been experience a crash on calling FB.logout() in a PhoneGap application using this plugin.

The environment I am using is:

PhoneGap 1.3.0
jQuery Mobile 1.0
Current Version on this plugin (phonegap-plugin-facebook-connect)
XCode 4.1
Mac OS X 10.7.2

The following function was crashing when loggin out:
=========================================
- (void) logout:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
if (!self.facebook) {
return;
}

NSString* callbackId = [arguments objectAtIndex:0];// first item is the callbackId

[facebook logout:self];

PluginResult* result = [PluginResult resultWithStatus:PGCommandStatus_OK];
[super writeJavascript:[result toSuccessCallbackString:callbackId]];
}

I was able to fix the crash by removing the: "self" from the line: [facebook logout:self];

- (void) logout:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
if (!self.facebook) {
return;
}

NSString* callbackId = [arguments objectAtIndex:0];// first item is the callbackId

[facebook logout];

PluginResult* result = [PluginResult resultWithStatus:PGCommandStatus_OK];
[super writeJavascript:[result toSuccessCallbackString:callbackId]];
}

I wonder if anyone is having a similar issue or if there is a related bux to this.

Warmest,

--
R. Javier Vega