Android facebook sdk 3.0 login by custom button. I dont want to use fragment . Just click a button then facebook login fetch the user name ,email,uid and the access token.
If facebook login in a dialog box there is no problem.
Android facebook sdk 3.0 login by custom button. I dont want to use fragment . Just click a button then facebook login fetch the user name ,email,uid and the access token.
If facebook login in a dialog box there is no problem.
1- add facebook login activity in your AndroidManifest.xml
2- on button click
This will open facebook login activity.
I recommend you this material about facebook Session: https://developers.facebook.com/docs/reference/android/3.0/Session/
Session can be managed by UiLifecycleHelper
I realize this is an old thread but I was having a similar issue and the other answer did not work for me. I wanted to have my own custom button have the same functionality as the built in Login Button.
The first step was to include the built in facebook button in my xml file but set its visibility to "gone" so it cannot be seen by the user.
In my main activity, I then defined the hidden facebook button and the button I wanted to use
Then in an onClickListener for the custom button, I used the ".performClick" method on the facebook button
This works like a charm for me. Hopefully this can help somebody.