有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

使用facebook应用程序范围id的java xmpp/smack聊天

我正在尝试开发一个facebook应用程序,以便它能够检索用户信息,如果需要,我可以使用java使用xmpp/smack api与用户聊天

我已成功使用原始Id发送facebook聊天

例如:

对于用户facebook。com/xxxxxxxx原始Id为“10000xxxxxxxxx”。(我们可以通过graph.facebook.com/xxxxxxx获得)我们可以通过以下方式与用户聊天:-10000xxxxxxxxx@chat.facebook.com

但问题是,通过使用facebook应用程序,我们无法获得用户的原始Id。尽管我们在2014年4月30日授予了原始用户访问facebook应用程序的权限,但仍无法从原始用户的facebook Id获得访问权限

请参阅facebook文档:

developers.facebook.com/docs/apps/upgrading

[ 1. App-scoped User IDs

Facebook will begin to issue app-scoped user IDs when people first log into an instance of your app coded against v2.0 of the API. With app-scoped IDs, the ID for the same user will be different between apps.

]

那么,即使我们获得了facebook用户的聊天许可,如何使用应用程序范围的Id与该用户聊天呢

对于用户“10000xxxxxxxx”,我得到应用范围ID“764965xxxxxxxxx”

这些是当用户接受我的聊天请求时我得到的JSON数据

{ "id": "7649xxxxxxx", "bio": "....", "email": "xxxxxxxxx\u0040gmail.com", "first_name": "xxxxxxxxxxx", "gender": "male", "last_name": "xxxxxxxx", "link": "facebook.com/app_scoped_user_id/7649xxxxxxxx/", "locale": "en_US", "name": "xxxxxxxxxxx", "timezone": 5.5, "updated_time": "2014-06-07T06:49:04+0000", "verified": true }

请帮我一个忙,并给出使用应用程序范围ID进行聊天的解决方案(无论我如何不违反facebook条款,我都会通知用户,并在他允许的情况下获取用户信息,)

提前感谢,


共 (0) 个答案