gpt4 book ai didi

Android Facebook 应用程序与 GAE 的集成

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:01:00 24 4
gpt4 key购买 nike

我在思考如何解决下一个问题:

  1. An Android App which I want to connect to facebook, and to a Server backend(Srv).
  2. Server backend(Srv) which I want to connect to facebook.
  3. The server will run a task that will Get all the Friends of the user(on fb), and the user Statuses(on Fb), and store them on it.

基本假设:

  1. I use android as a Mobile device
  2. Server is GAE
  3. Entity key in GAE is the user’s FB-id
  4. User Entity contains:
    1. User fb_id
    2. User verified list(FB_ID String)=> friends of the user that have the app) // maybe use HT?
    3. User statuses list(Status text, date, url)=> whatever I can get from a Status of a user in facebook..

主要问题:

  1. Is the Data representation thought out? can it be better?
  2. How do I handle a situation where two users which are connected to one another add the app at the same time- how can I avoid overlapping?
  3. Should the device Authenticate itself, also with the GAE server?
  4. How to Authenticate GAE with FB

算法:

安卓端:

 User login and get access token from FB
Posting to my server(Srv) FB Token & myUserFBId // Should I use REST protocol or HTTP

发布?

服务器端:

  A Servlet handles the POST   
{
Query FB ->for the user's friends ids(into friendList = arrayList<FBItem))
foreach FBItem item in friendList
{
//check which FB-ids are in my DB
friendEntity = getKey(item.fb_id)
if(friendEntity != null)
{
// friend exists
verifiedFriendsList.add(item.fb_id) //verifiedFriendsList is ArrayList<String>
friendEntity.getVerifiedFriendList().add(myUserFBId)
}
}
Query FB ->for the user's statuses(into statuses = arrayList<StatusItem))
add new FBEntity(myUserFBId, verifiedFriendsList, statuses) to DB }

谢谢

最佳答案

我没有做过这样的事情,但我认为你需要做

  1. 要求用户验证您的应用程序以使用 FB- 阅读有关 Facebook 的 OAuth Api
  2. 一旦您的应用通过足够权限的身份验证,您就可以根据您的要求获取用户数据。
  3. 一旦获得数据,您就可以对其进行处理。

FB 上的 Oauth 就是您正在寻找的..

关于Android Facebook 应用程序与 GAE 的集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15139997/

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