0

I want to make a facebook test user by using koala and want to access email of them, so I asked this question.

https://stackoverflow.com/questions/32806541/cant-get-facebook-users-email-by-using-koala

But the question is marked duplicated I'll ask a bit different.

What I tried was like this:

 test_users = Koala::Facebook::TestUsers.new(app_id: ENV['FACEBOOK_KEY'], secret: ENV['FACEBOOK_SECRET'], scope: 'email')
  test_user = test_users.create(true)
  test_user
=> {"id"=>"136050390082149",
 "access_token"=>
  "CAAKzdWDYd50BAH01c0G4DbnfSuLuLqGMu3EB232dUiq2iYZAy5A4yZBhxRPmcKWeu01PI2zZC7IZBsZBx1DcA9ZCLwsojXZAWFgjOKL64Ef7ZBTMN79YPKHRyaLEc2QIPVd7cZCx6kSVAZAptKTZBZByi8SZBc7CK02YD0eMLtnIXoasxgdIkmVPUV4ZBXpuXixy26IuAZD",
 "login_url"=>"https://developers.facebook.com/checkpoint/test-user-login/136050390082149/",
 "email"=>"awoxmwf_chaisky_1443410083@tfbnw.net",
 "password"=>"1836830566"}

  graph = Koala::Facebook::API.new(test_user['access_token'])
  graph.get_object('me?fields=id,email')

With this code I only got id attribute.

How can I make a test user that have email and have permission to access the email by using Koala?

Community
  • 1
  • 1
ironsand
  • 14,329
  • 17
  • 83
  • 176
  • 1
    Are you using v2.4 of the Graph API? If yes, then you will need to need to declare all the fields you want the API to return like `/me?fields=name,email` https://developers.facebook.com/docs/apps/upgrading#v23tov24 – bangdel Oct 02 '15 at 14:55
  • Thanks for reply. I found out I couldn't get email because I didn't make my app "live". http://stackoverflow.com/questions/20696738/i-am-new-how-do-i-make-my-app-live-on-fb – ironsand Oct 02 '15 at 21:52

0 Answers0