【发布时间】:2012-12-01 03:02:22
【问题描述】:
最终,我想要一个可以访问我的应用程序管理部分的用户 ID 白名单。我希望使用 Facebook 身份验证和相关的用户个人资料 ID 来处理这个问题。
目前,我有:
if (session == Session.getActiveSession()) {
if (user != null) {
// Set the id for the ProfilePictureView
// view that in turn displays the profile picture
profilePictureView. setProfileId(user.getId());
// Set the Textview's text to the user's name
userNameView.setText(user.getName());
// Set the Textview's text from user's id
userId.setText(user.getId());
String approved = "553660552";
if(user.getId() != approved){
//553660552
userId.setText(user.getId());
} else {
userId.setText("Goodie");
}
}
}
user.getId() 返回 553660552,但比较失败。 (当批准是不同的值时,它也会失败)。
总而言之,user.getId() 返回 553660552(在这种情况下)。我需要能够对白名单进行匹配比较。是的,任何设置为“553660552”的String 都不匹配
感谢所有帮助。
【问题讨论】:
标签: java android facebook facebook-graph-api sdk