17 thoughts on “Android Studio Facebook API – Episode 2 – Login with Facebook | Website thông tin các mẹo có ích nhất

  1. WittCode says:

    READ IF PROFILE PICTURE NOT LOADING

    There seems to have been an update where the profile picture is not loading using the user ID anymore. To fix this do as follows:

    1. In the video where I create a the bundle to talk to the Facebook Activity add the parameter "picture" to it.
    parameters.putString("fields", "email, gender, picture");

    You can also specify the height and width of the picture by using
    parameters.putString("fields", "picture.width(150).height(150)");
    where 150 is in pixels!

    2. Next, a nested JSON object will be returned from your graph request in the onCompleted method. So here you retrieve it like so.
    String pic = object.getJSONObject("picture").getJSONObject("data").getString("url");

    3. Load the picture by using Picasso like in the video like this:
    Picasso.get().load(pic).into(imageView);

    This should get your profile picture to load. Let me know if this helps!

  2. Basma says:

    Hi @WittCode what about the update of facebook sdk of checking the loggedIn status? if access token is expired or not?
    could help with an example?

  3. Alvin Yanson says:

    Thanks for explaining every detailed section of implementing Facebook login. Those part are very important especially for beginners.

    Roses are red, violets are blue, WittCode deserves a million views 🔥🔥🔥

  4. ali kemal Kemal says:

    Hello. There is a leak in my facebook login when I scan with leakcanary. Do you have a leak problem in your application? Thanks

  5. Nesib Eyyubov says:

    What if i don't want to save login state inside shared preferences? i just want to get user information like profile image and send it to my custom server

  6. gokul j says:

    i was stuck at work with this task… You saved me… Thanks a ton man!!!…. why don't you start a beginner android course… would love to watch it!!

  7. Force Porquillo says:

    Thank you for your detailed tutorial especially in that graph request and add testers! I was stuck with this for two weeks or so and I just forgot that my app was still in development mode and forgot to add some testers. <3

    Thank you for your work! +1 sub

  8. Vasilis Xristopoulos says:

    @WittCode hi and congrats for your videos. However, it seems that I have run into a problem. When pressing the button I get a Facebook error saying Invalid key hash. The key hash "aKey" does not match any stored key hashes. Configure your app key hashes at "a link leading to my app". Do you have any recommendations?

  9. Mohsin Sachdeva says:

    Might I add that i am very very grateful to you. you work has saved me many hours. Thank you immensely. looking forward to more videos. subscribing now.

  10. Sumit Rohilla says:

    Hey, I'm using my device instead of AVD of android studio, whenever I click login and logout, my app force closes..
    What should I do?

  11. muhammad omar farooq says:

    thanks for the tutorial these are awesome, keep it up !!
    but here is some problem , i am facing the following problem ,my profilepic is not loading while name gender etc is correctly loaded please check and help if u can thanks !!

    here is the error :

    "E/GraphResponse: {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Object with ID '3414097405351484' does not exist, cannot be loaded due to missing permissions, or does not support this operation "

  12. Abeeq Jafar says:

    Do we need to submit the app for app review before getting data like profile picture, because i get this error everytime {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Object with ID 'XXXXXXXXXXXXXXXXX' does not exist, cannot be loaded due to missing permissions,….) Also this is the screenshot of FB login page that i see. https://imgur.com/NtieSYw

  13. Cursed Trousers says:

    Thanks man I had a lot of trouble getting the key hash so I like how you went through it slowly and explained what it does

  14. Deepak Bisht says:

    If you are teaching something do it proper. You edited out two error warning throughout the video. One related to adding constraints and second related to method overriding at 19:55.

Comments are closed.