在Facebook accountkit android设备中获取AccessToken null

时间:2016-09-08 17:58:03

标签: android facebook facebook-access-token account-kit

Using this sample I am easily able to run and get access token 但是当我在自己的应用程序中实现它时,返回null值。

2 个答案:

答案 0 :(得分:1)

确保您已启用启用客户端访问令牌流程如图所示。
https://developers.facebook.com>你的应用> Acountkit>设置

enter image description here

答案 1 :(得分:1)

更新:

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

请确保您使用 AccountKitActivity.ResponseType.TOKEN

============= 你试过了吗?

  

使用Android 6.0自动备份访问令牌

     

帐户套件访问令牌与Android 6.0,Marshmallow中引入的自动备份功能不兼容,因为备份的访问令牌可能不再有效。当您的应用使用此类无效令牌时,它不会收到Facebook数据作为回报。要防止出现此问题,请从自动备份的数据中排除访问令牌。

     

为此,请在项目中创建资源XML文件,例如res / xml / backup_config.xml,其中包含以下上下文。

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

然后引用`application&#39;中的资源文件。标记清单。

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

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

相关问题