Last_Crypto
Last_Crypto

Reputation: 81

Getting AccessToken null in Facebook accountkit android device

Using this sample I am easily able to run and get access token but when I implement the same in own application its returning null value.

Upvotes: 2

Views: 1039

Answers (2)

Chi Minh Trinh
Chi Minh Trinh

Reputation: 296

Update:

AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder =
                new AccountKitConfiguration.AccountKitConfigurationBuilder(
                        LoginType.PHONE,
                        AccountKitActivity.ResponseType.TOKEN);

Please make sure that you are using AccountKitActivity.ResponseType.TOKEN

============= Have you tried it:

Access Tokens with Android 6.0 Auto-Backup

Account Kit access tokens are not compatible with the auto backup feature introduced in Android 6.0, Marshmallow, because the backed up access token may no longer be valid. When your app used such an invalid token, it doesn't receive Facebook data in return. To prevent this problem, exclude the access token from the data that is automatically backed up.

To do this, create an resource XML file in your project,for example, res/xml/backup_config.xml, with the following context.

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <exclude domain="sharedpref" path="com.facebook.accountkit.AccessTokenManager.SharedPreferences.xml"/>
</full-backup-content>

Then reference the resource file in the `application' tag in your manifest.

<application ...  android:fullBackupContent="@xml/backup_config">

https://developers.facebook.com/docs/accountkit/accesstokens

Upvotes: 1

yubaraj poudel
yubaraj poudel

Reputation: 3889

Be ensure you have turned Enable Client Access Token Flow As shown in picture.
https://developers.facebook.com > Your App > Acountkit > Setting

enter image description here

Upvotes: 1

Related Questions