Skip to content

missing userID on responses #21

@oodavid

Description

@oodavid

I should have written this one yesterday as the exact details have slipped my mind.

However, many responses should have a userID parameter, on iOS this is often an empty string "" on Android I have seen "null".

My fix is to store the accessToken in localStorage, whenever it changes I make a request to /me to get the users details, ie:

var dealWithStatusAndAuth = function(response){
    if(tokenhaschanged){
        FB.api('/me', {fields: 'id,first_name,last_name'}, bind(this, function(response){
            // store the id and details for later use
        }));
    }
}
FB.Event.subscribe('auth.statusChange',        bind(this, dealWithStatusAndAuth));
FB.Event.subscribe('auth.authResponseChanged', bind(this, dealWithStatusAndAuth));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions