I hate to add more to this saga, but I can’t help myself. I had to test what would happen if I didn’t call facebook.logout() after calling facebook.login( myAppID, myFBListener, { “email” } ) to fetch the user login credential – on both build 991 and 1008.
The result was identical. It surprised me. I thought the issue was introduced when FB SDK was updated, but it looks like that was not the root cause of the issue.
Edit: I was testing on wrong build. I needed to test on 990 and 1008 to see the difference. And the result was not identical. It was different like night and day. The case 4 result detailed below is with 1008 which incorporated updated FB SDK. My post #46 shows the case 4 result with 990 that uses un-updated FB SDK.
I followed the CASE 2 procedure – meaning, I did not intentionally cancel the login process because I really wanted the FB login process to work:
CASE 4: (modified version of CASE 2 with a freshly wiped device with a new user)
1 (scene A): facebook.login( myAppID, myFBListener, { “email” } )
* User skips the FB Connect button
2 (scene B): facebook.login( myAppID, myFBListener, { “email” } )
* This scene has FB Connect button this time (instead of FB Friend button).
* FB Connect button brings up FB Log in screen
* User enters FB email address and FB password
* FB permission screen with email as part of the app requirement come up
* User taps on Log in button
* Login process completes without a hitch and automatically triggers facebook.request( “me” ) in step 3
3 (scene B): facebook.request( “me” )
* Fetches login credential perfectly
* Do not call facebook.logout() here – I commented it out from the script
* Saves login credential for the app
* Upon successful save, automatically triggers facebook.login( myAppID, myFBListener ) in step 4
4 (scene B): facebook.login( myAppID, myFBListener )
* Immediately after the login process completes, FB permission screen comes up (stating that the user has already authorized this app)
* User okays it
* Then the screen goes back to my app, while I also get Error: HTTP status code: 400
* My app screen says Facebook login failed.
* User closes the login fail notice.
5 (scene B): facebook.login( myAppID, myFBListener )
* The screen updates to show FB Friends button.
* Tapping on it launches facebook.login( myAppID, myFBListener )
* Which brings up FB permission screen again (stating that the user has already authorized this app)
* Tapping okay triggers Error: HTTP status code: 400 again.
* My app screen says Facebook login failed.
* User closes the login fail notice.
* And this step 5 repeats itself over and over.
* All the other parts of the app appears to behave and function as expected. I just can’t go anywhere beyond this step 5 with FB feature of the app.
* So I killed the app and relaunched it.
6 (scene B) – tapping on FB Friends button brings up friends list (the buttons) without asking for FB permission, and it works smoothly without a hitch.
So it appears, adding the facebook.logout() was absolutely necessary to avoid the error 400. I think it was haakon who identified and posted the need to add facebook.logout() in some other thread somewhere – thank you (and if it was someone else, whoever it was, thank you.) It was frustrating process, but this really got me trapping all sorts of potential errors that could crash my app.
Also, you wouldn’t encounter this issue if you don’t need the login to require email as part of the parameter (and if so, you may not need to call facebook.logout). In my app, under this specific path user takes, it is necessary.
Anyhow, I hope this test result helps others who come across the same error.
Naomi
[import]uid: 67217 topic_id: 34416 reply_id: 140422[/import]