Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getLoginStatus return object fix #584

Merged
merged 1 commit into from Jul 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -217,7 +217,7 @@ public void call(Session session, SessionState state, Exception exception) {
}
return true;
} else if (action.equals("getLoginStatus")) {
callbackContext.success(Session.getActiveSession().getState().toString());
callbackContext.success(getResponse());
return true;
} else if (action.equals("getAccessToken")) {
Session session = Session.getActiveSession();
Expand Down Expand Up @@ -569,7 +569,6 @@ public JSONObject getResponse() {
"\"expiresIn\": \""+expiresIn+"\","+
"\"session_key\": true,"+
"\"sig\": \"...\","+
"\"userId\": \""+this.userID+"\","+
"\"userID\": \""+this.userID+"\""+
"}"+
"}";
Expand Down
Expand Up @@ -501,13 +501,12 @@ - (void) makeGraphCall:(NSString *)graphPath
}];
}

- (NSDictionary*) responseObject
{
NSString* status = @"unknown";
NSDictionary* sessionDict = nil;
- (NSDictionary *)responseObject {
NSString *status = @"unknown";
NSDictionary *sessionDict = nil;

NSTimeInterval expiresTimeInterval = [FBSession.activeSession.accessTokenData.expirationDate timeIntervalSinceNow];
NSString* expiresIn = @"0";
NSString *expiresIn = @"0";
if (expiresTimeInterval > 0) {
expiresIn = [NSString stringWithFormat:@"%0.0f", expiresTimeInterval];
}
Expand All @@ -521,7 +520,7 @@ - (NSDictionary*) responseObject
@"secret" : @"...",
@"session_key" : [NSNumber numberWithBool:YES],
@"sig" : @"...",
@"userID" : self.userid,
@"userID" : self.userid
};
}

Expand Down
2 changes: 1 addition & 1 deletion www/js/facebookConnectPlugin.js
Expand Up @@ -15,7 +15,7 @@ if (!window.cordova) {
// Try will catch errors when SDK has not been init
try {
FB.getLoginStatus(function (response) {
s(response.status);
s(response);
});
} catch (error) {
if (!f) {
Expand Down