-
Notifications
You must be signed in to change notification settings - Fork 135
Facebook - dictionaryWithRemoteAccount have no checks for nil in optional values #59
Comments
Also encountered this issue. Recommend next version uses [user setValue:remoteAccount[@"username"] forKey:@"nickname" ]; etc. since nil will just remove the key, and we can check NSDictionary @"whatever" for nil in response if we're going to use any particular parameter. |
I was just coming here to post this issue, just encountered it in production, hadn't seen it happening before. |
@calebd I don't think 331a08a the correct fix for this. The username is an optional field which if it is present, I would like to have it. If it is not available, it should be blank or nil. I would add a check around the username to make sure it's not nil, instead of just removing the field, because the nickname is something that people do use. |
@mergesort It wasn't what I wanted to do originally, but after looking into it I couldn't find the username field documented by Facebook on user responses at all. Also, my Facebook user has a username but that never came down from the authorization API. I can put it back for sure if you are seeing a different behavior. |
username is no longer available in the Facebook API, starting in 2.0. |
@markkrenek @calebd Ah, my mistake. I wasn't aware of the changes since they haven't fully deprecated it yet (it's still working for apps created before April 30th, 2014). Carry on then... |
For example, let's see at User Info block:
But my own profile has no Username and my app will crash when I try to authorize via Facebook.
The text was updated successfully, but these errors were encountered: