分页不工作,也许我找到了症结 [英] Paging does not work and maybe I found the cause

查看:128
本文介绍了分页不工作,也许我找到了症结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现的流(新闻供稿)分页功能,以我的应用程序,但预期这是行不通的。我发现有很多类似的问题在这里,但没有解决办法来解决这个问题。

I am trying to implement the stream (news feed) paging function to my app, but it does not work as expected. I found many similar question here but there are no solution to solve this problem.

我想这两个图形API和FQL和行为是相似的。它的成功得到结果一两次,但在那之后,它无法得到的结果(得到空JSON数组)。

I tried both Graph API and FQL and the behavior was similar. It success to get the result one or two times but after that, it fails to get the result (gets the empty JSON array).

最后,我发现这个问题取决于 access_token 。如果我只是改变了源$ C ​​$ C使用Android SDK流实例的应用程序ID,而不是我自己的应用程序ID进行身份验证,它完美的作品。

Finally, I found this problem depends on access_token. If I just change the source code to use Android SDK Stream Example App ID rather than my own App ID for authentication, it works perfectly.

所以,我相信,Facebook服务器检查应用程序ID,并返回一些奇怪或限制 access_token 我的应用程序。

So, I believe facebook server checks the App ID and returns some weird or restricted access_token to my app.

是否有任何的条件,以获得有效的 access_token ?我试图与Android SDK流示例应用程序完全相同的权限,但它不可能解决问题。

Are there any condition to get the valid access_token? I tried the exact same permissions with Android SDK Stream example app but it could not solve the problem.

我想分享这些信息与谁正面临着同样的问题,是否改变了应用程序ID(以获得有效的 access_token )将解决你的情况任何人。

I want to share this information with anyone who are facing the same problem and check if changing the App ID (to get the valid access_token) will solve your case.

推荐答案

使用Facebook SDK的机器人。它可以在这里找到 。有getter和setter方法​​获取和设置的访问令牌。当您第一次做单点登录(SSO),则必须保存在共享preferences访问令牌,而且也没有必要一次又一次的重新认证。只需设置访问令牌从preferences并拨打电话向饲料对话框。该offline_access权限是为德precated。 Facebook的SDK为Android做的工作休息。只需通过捆绑提供足够的PARAMS。

Use the facebook sdk for android. It can be found here. There are getter and setter methods to get and set the access token. The first time you do a Single-Sign-On (SSO) you must save the access token in SharedPreferences and there's no need to reauthenticate again and again. Just set the access token from your preferences and make a call to the feed dialog. The offline_access permission is to be deprecated. The facebook sdk for android does the rest of the work. Just supply sufficient params through Bundle.

这篇关于分页不工作,也许我找到了症结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆