即使用户允许电子邮件访问,我也会收到以下错误
"Your application may not have access to email addresses or the user may not have an email address"
虽然Twitter支持说
"Your app has all necessary permissions to request user emails. "
并且在apps.twitter.com的权限中,据说
Can request a user's email address
我的代码是
TwitterAuthClient authClient = new TwitterAuthClient();
authClient.requestEmail(session, new Callback<String>() {
@Override
public void success(Result<String> result) {
// Do something with the result, which provides the email address
Log.i("email","Access granted");
Toast.makeText(LinkedInActivity.this,"Access granted",Toast.LENGTH_SHORT).show();
}
@Override
public void failure(TwitterException exception) {
// Do something on failure
Log.i("email","Access denied"+exception.getMessage());
Toast.makeText(LinkedInActivity.this,"Access denied"+exception.getMessage(),Toast.LENGTH_SHORT).show();
}
});
答案 0 :(得分:0)
我已经解决了这个问题..问题是Twitter已经登录了。虽然我已多次退出但没有工作。
然后我清除了twitter应用程序的缓存和数据,然后运行我的应用程序,现在我可以使用面料从Twitter访问电子邮件地址