1

We have seperate URLs for our webapp on local development and on build servers (acceptance test environment) This means that we have to setup 2 seperate Test Apps for Local and Acceptance Test.

When creating test users it seems they can only be created to be valid on only 1 test app... and I have not been able to find a way to share test users between test apps. Not being able to do this makes automated acceptanse testing a pain... as we have to have seperate testdata for Local testing and acceptance testing.

Would love to hear any suggestions on how to solve this easily?

Lisa-Marie
  • 383
  • 1
  • 4
  • 14

3 Answers3

1

Simple example with curl (its not possible to do it from the Dashboard)

Copy

curl -i -X GET \
 "https://graph.facebook.com/v2.9/SOURCE_APP_ID/accounts/test-users?access_token=SOURCE_APP_ACCESS_TOKEN"

Paste

curl -i -X POST \
 -d "uid=TEST_USER_ID" \
 -d "owner_access_token=SOURCE_APP_ACCESS_TOKEN" \
 -d "access_token=TARGET_APP_ACCESS_TOKEN" \
 "https://graph.facebook.com/v2.9/TARGET_APP_ID/accounts/test-users"
Jaime Agudo
  • 8,076
  • 4
  • 30
  • 35
0

Afaik you can only create test users for one App, but you can also create them with the API as it is explained in the Facebook docs: https://developers.facebook.com/docs/apps/test-users

Direct link to example code: https://developers.facebook.com/docs/graph-api/reference/v2.2/app/accounts/test-users

andyrandy
  • 72,880
  • 8
  • 113
  • 130
0

Create a test user and then use the API to connect the user to the second app.

WizKid
  • 4,888
  • 2
  • 23
  • 23
  • This procedure is an absolute pain anyway, the proof indeed is that not even you (as FB worker) can provide a simple example. To just GET the users from the parent app is a trial & error procedure due the lack of synch between docs and real API and the complex token behaviour. Nothing to say about POST ing. – Jaime Agudo May 14 '17 at 17:27
  • I confirm as per https://developers.facebook.com/docs/apps/test-users/#graphapimanage that today is not yet possible to do it without using the graph API, congrats Facebook – Jaime Agudo May 14 '17 at 17:45
  • My comment is 3 years old to start with. Secondly what do you mean I can't provide a simple example? The documentation you link to links to https://developers.facebook.com/docs/graph-api/reference/v2.9/app/accounts/test-users that explains how to connect an existing test user with a second app. And yes you need to use the API for it. – WizKid May 14 '17 at 18:23
  • I realised of the date and please don't take my criticism about the lack of _sample code, examples_ personally @wizkid, my target was Facebook not you :) Thanks for pointing in the right direction – Jaime Agudo May 14 '17 at 18:47