Search code examples
iphoneiosfacebookfacebook-ios-sdkfacebook-test-users

Can't login via Facebook iOS SDK 3 with a test user


Have a code that is working with ordinary FB user (login and post). Just created test user but unable to login. Getting message "we didn't recognize your email address or phone number". After calling https://graph.facebook.com/362652477144946/accounts/test-users?... I got:

{
  "id": "100004233554579",
  "access_token": "...",
  "login_url": "https://www.facebook.com/platform/test_account_login.php?user_id=100004233554579&n=Ffaa4FVusNloYGS",
  "email": "iosproject_gaxfjez_iosproject\u0040tfbnw.net",
  "password": "..."
}

Tried entering "100004233554579", "Ffaa4FVusNloYGS" and "iosproject_gaxfjez_iosproject\u0040tfbnw.net" at username but nothing works. Any ideas?

UPDATE1 Noticed "\u0040" in email, so changed that to "@". But then getting "We didn't recognize your email" :)

UPDATE2 Noticed there's another email "100004233554579@facebook.com" when logged to Facebook login_url but it doesn't work too.


Solution

  • I faced the same problem with test facebook user login from mobile device - "we didn't recognize your email address or phone number".

    What I did:

    • Went to dev console and created new test user
    • Clicked edit and changed password in console - than was a mistake

    After you change password via dev console - facebook also changes test email. And you are able to login only at facebook.com website (not android, iOs or m.facebook.com) - because you get a security warning that email was changed. Also you can't use simple emails like qwerty.

    What you need to do to get it work:

    • Create new test user in console (do not change anything)
    • Go to Graph API, generate application token, get test users via {app_id}/accounts/test-users (details)
    • POST new password (only password) to the test user /{user_id} (details)
    • Now you shall be able to login using m.facebook.com, Android or iOS apps

    A little bit wierd