Hi,
I would like to know if this is already supported in the SDK for android. Currently I’m only using name, email and gender for the field mappings (Google+ and Facebook). However, I would also like to include the Profile Picture URL if possible.
Are there any documentations on how to implement this using the SDK?
Thanks,
Allen
Hi Allen!
I think you can use the following algorithm:
- Login user with Facebook and get user id
- Run request http://graph.facebook.com/100001574818751/?fields=picture&type=large, where
100001574818751 is user id.
- In response you receive “url” with link to picture.
- Get link to picture and update user with property “avatar”. Set picture url as value of this property.
Hi Anton,
Thanks.
I was hoping it would be integrated in the SDK itself. But based on your answer, it seems that I may need to do additional http requests after SDK login, which is not actually a problem for me. Just wanted to clarify if there was a need to do the extra work.
For others reference, to get Google+ profile pic.
https://www.googleapis.com/plus/v1/people/115950284...320?fields=image&key={YOUR_API_KEY}
where:
115950284…320 is the ID
YOUR_API_KEY is the API KEY from https://console.developers.google.com/
Regards,
Allen
Yes. You have to do this manually.
But you could do this on backend using Backendless Business Logic by adding afterSocialRegister event handler
This way, anytime, social user registers, your server code will retrieve the user picture from the corresponding social network and will update user’s record in the database
This process can be done asynchronously (in the background) and not blocking user’s registration
Thanks. I’ll keep this in mind.