查找哪些用户的朋友也使用我的 Facebook 应用程序
我已经看过有关此问题的其他答案,但有一些不同的问题。
我是 Facebook 开发新手,所以请耐心等待,但我正在创建一个 Android 应用程序并想使用 Facebook。我想找出当前用户的哪些朋友也使用我的应用程序,我已经实现了一种方法来执行此操作,但我认为它不是最有效的,甚至不是 Fb ToS 允许的。
到目前为止,每次用户与我的应用程序交互时,他们的 uid 都会发送到我自己的数据库,该数据库要么添加 uid,要么只是检查它是否已经存在。当用户想要查找使用该应用程序的其他朋友时,嵌套循环会通过用户朋友的 uid 与我的数据库中的 uid 进行比较,并以这种方式找到它们。对于相当多的用户和朋友来说,这需要几秒钟的时间,所以我不敢想象如果我的应用程序成功需要多长时间。
我现在想要另一个数据库表来存储使用该应用程序的朋友的 uid,因此当发生上述循环时,用户的 uid 和所有使用应用程序的朋友的 uid 一起存储在一个表中,这会让它变得更复杂当用户再次执行“朋友搜索”时速度会更快,因为他们的许多朋友已经被认为是用户。
我的问题是我不知道 Facebook ToS 是否允许这样做?我可以保留uid吗?如果是这样,我是否可以按照我的建议保留 uid 之间的关系?
我知道您可以执行 FQL 查询来比较朋友与使用该应用程序的用户,但我使用的 Android Facebook SDK 称为 Easy Facebook Android SDK 出于某种原因将 FQL 查询返回为 XML 而不是 JSON(即使查询末尾有“&format=json”:-/),而且我并不是 XML 的真正粉丝,也不喜欢不想乱搞SAX(如果我不需要的话),因为我在我的方法中使用 JSON,因为我已经在我的应用程序中为其他事情实现了 JSON。
我还了解 REST API 方法 getAppUsers(),但不想使用它,原因很简单,它是遗留的,可能随时被弃用。
感谢您阅读所有这些苦差事:-)
希望您能提供帮助,
Infinitifizz
I've seen the other answers about this but have a few different questions.
I'm new to Fb Development so bear with me but I am creating an Android app and want to use Fb. I want to find out which of the current user's friends also uses my app, I have implemented a way to do this but I don't think it is the most efficient or even allowed by Fb ToS.
So far, everytime a user interacts with my app, their uid is sent to my own db which either adds the uid or just checks that it's already in there. When the user wants to find other friends that use the app, a nested loop works through the user's friends' uids comparing with the uids in my db and finds them that way. This takes a few seconds with quite a few users and friends so I dread to think how long it would take if my app was successful.
I am now wanting to have another db table that stores uids of friends that use the app, so when the above looping occurs, the user's uid and all their app-using friends' uids are stored in a table together, this would make it much quicker when the user performs the "friend search" again, as many of their friends will already be known to be users.
My question with this is that I don't know if this is allowed by Fb ToS? Am I allowed to retain uids? And if so, am I allowed to retain relationships between uids as I propose?
I know that you can do FQL queries to compare friends with users that use the app but the Android Facebook SDK I am using called Easy Facebook Android SDK for some reason returns FQL queries as XML rather than JSON (even though the query has "&format=json" on the end :-/) and I'm not really a fan of XML and don't want to be messing around with SAX if I don't need to, as I am using JSON for my method because I already have JSON implemented in my app for other things.
I also know about the REST API method getAppUsers() but don't want to use this for the simple reason that it is legacy and could be deprecated anytime.
Thanks for reading all this drudge :-)
Hope you can help,
Infinitifizz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于FB政策,我不认为你违反了它们。最多,您需要将其添加到您的隐私政策中:
但是,查看该库,似乎他们正在使用已弃用的旧 REST API(即 URL
https://api.facebook.com/restserver.php?method=fql.query ...
而不是https://api.facebook.com/method/fql.query?...
)我要么 (1) 联系他们看看他们是否会更新尽快使用该库或 (2) 使用另一个库(例如 android-facebook-sdk)。
Regarding to FB policies, I do not think you are breaking them. At most, you will need to add it to your privacy policies:
But, looking at that library, it seems that they're using the old REST API that is being deprecated, (i.e.., URL
https://api.facebook.com/restserver.php?method=fql.query...
instead ofhttps://api.facebook.com/method/fql.query?...
)I would either (1) contact them to see if they will update the library soon or (2) use another library (such as the android-facebook-sdk).