Reputation: 31
I have created a Facebook app that is currently running in development mode. I can log in fine on iOS with my development Facebook account and everything seems to work.
I have created some test users using roles-> Test Users. I have added a password to that user using the interface there. In the device's settings, I have logged in as the test user with the generated email and the password I have set and that works. I do not have the Facebook app installed.
When I try to log in to Facebook in my app as this test user, it says the usual <"AppName" would like to access your basic profile info and list of friends> and I tap "ok". Then, I get the following error in XCode:
session creation error: Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x1b0313a0 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:SystemLoginError, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: Invalid application APP_ID" UserInfo=0x1affbef0 {NSLocalizedDescription=The Facebook server could not fulfill this access request: Invalid application APP_ID}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x1b0322a0, state: FBSessionStateClosedLoginFailed, loginHandler: 0x0, appID: APP_ID, urlSchemeSuffix: local, tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x155850d0>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>} userInfo: {
"com.facebook.sdk:ErrorInnerErrorKey" = "Error Domain=com.apple.accounts Code=7 \"The Facebook server could not fulfill this access request: Invalid application APP_ID\" UserInfo=0x1affbef0 {NSLocalizedDescription=The Facebook server could not fulfill this access request: Invalid application APP_ID}";
"com.facebook.sdk:ErrorLoginFailedReason" = "com.facebook.sdk:SystemLoginError";
"com.facebook.sdk:ErrorSessionKey" = "<FBSession: 0x1b0322a0, state: FBSessionStateClosedLoginFailed, loginHandler: 0x0, appID: 535528973215605, urlSchemeSuffix: local, tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x155850d0>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>"; }
Where APP_ID is the configured app id. Note that this is the same error a regular user would get if not set as a developer or tester.
I don't believe I am doing something wrong in the code, as it does work with my dev account.
Is there anything I need to do to mark the test users as testers? Facebook's documentation says (https://developers.facebook.com/docs/apps/test-users):
Test users will only have 'Tester' privileges on the associated app. This means that they can use the app in live mode or sandbox mode, but cannot edit any technical settings or access insights for that app.
That to me is implying that this should work.
So, in short, how can I log into my app as a test user?
Upvotes: 0
Views: 1001
Reputation: 1232
Not sure why it is, but Test Users will not be able to login via the iOS System Account. You need to create an actual Facebook account and then add the ID for the account as a tester to your app. It's a pain.
Upvotes: 2