I am using latest Facebook-sdk for Login with Facebook
implementation 'com.facebook.android:facebook-login:[5,6)'
Try to login with facebook using custom button
I am also getting this error in Facebook-android-sdk github issue https://github.com/facebook/facebook-android-sdk/issues/580 this issue resolved or not.
I want to open dialog if Facebook native app install, for that first I logout using LoginManager.getInstance().logOut()
I use default login manager like LoginManager.getInstance(), then login and logout , but when i check token after logout like this AccessToken.getCurrentAccessToken() it still exists
Below are my code:
callbackManager =
CallbackManager.Factory.create()
LoginManager.getInstance().logOut()
loginManager = LoginManager.getInstance()
LoginManager.getInstance()
.registerCallback(callbackManager, object : FacebookCallback<LoginResult> {
override fun onSuccess(loginResult: LoginResult) {
val graphRequest = GraphRequest.newMeRequest(loginResult.accessToken)
{ jsonObj, _ ->
}
val parameters = Bundle()
parameters.putString("fields", "id,name,email")
graphRequest.parameters = parameters
graphRequest.executeAsync()
}
override fun onCancel() {
}
override fun onError(error: FacebookException) {
var msg = ""
}
})
loginManager.logInWithReadPermissions(
this@SignUpActivity,
listOf("email", "public_profile")
)
Manifest file
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />