gpt4 book ai didi

Android Fql 查询异常

转载 作者:行者123 更新时间:2023-11-30 02:54:10 25 4
gpt4 key购买 nike

我是 Facebook SDK 的新手。我想从 facebook 获取 PostID 和 Message。这是我的安卓代码。

private void Fql() {
String fqlQuery = "SELECT post_id, message FROM stream WHERE source_id='100008169074385' ";
Bundle params = new Bundle();
params.putString("q", fqlQuery);
Session session = Session.getActiveSession();
Request request = new Request(session, "/fql", params, HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
MessageBox(response.toString());
}
});
Request.executeBatchAsync(request);
}

但是代码给了我一个异常(exception):“请求此资源需要访问 token ”。请任何人给我一些解决方案

最佳答案

这可能对你有帮助。

private void Fql() {


String fql = "SELECT link_id, title, summary, url from link WHERE owner = 'YourID'";

Bundle parameters = new Bundle();

parameters.putString("query", fql);
parameters.putString("method", "fql.query");



Session session = Session.getActiveSession();
parameters.putString("access_token", session.getAccessToken());

String response = null;
try {
response = fb.request(parameters);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

MessageBox(response);

}

关于Android Fql 查询异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23590646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com