Facebook Android SDK request parameters: where find documentation? [closed]

半世苍凉 提交于 2019-12-06 12:49:30

问题


Good evening. I'm developing an android application that uses Facebook SDK. I've no problem with user oauth authentication and I've no problem using the SDK to add a simple status update on the user wall.

Now I'm trying to use more deeply this Facebook Android SDK and I found a really big lack about documentation.

At the moment I'm using this snippet of code to add the user status:

        Bundle params = new Bundle();
    params.putString("message", "my message");
    params.putString("link", "my site url" );
    params.putString("name", "my name");
    params.putString("caption", "my caption" );

    mAsyncRunner.request(REQUEST_WALL_POST, params, HTTP_METHOD_POST, listener, null);

it works pretty well.

Now I want to add more content and attributes to this facebook status. For example (in my scenario) I want to add the user location (taken with Android GPS) to the facebook update. I tried to search into Facebook API Documentation but the only "semi-usefull" thing I found is this: https://developers.facebook.com/docs/reference/api/post/

For what I understand this explain which are a Post's return fields and not fields I can use to create a add-post request.

Anyway I found the "place" field:

place

Location associated with a Post, if any

object containing id and name of Page associated with this location, and a location field containing geographic information such as latitude, longitude, country, and other fields (fields will vary based on geography and availability of information)

I cannot find any kind of working example (or simple an example!!) to understand how to build this field and if I can or not pass to the Android bundle..

Can someone explain me?

UPDATE

I just made a share with SoundHound (a music application) and what I need is to perfeclty do something like it: https://www.facebook.com/emanuele.ricci/timeline/story?ut=64&wstart=1325404800&wend=1328083199&hash=-4777352490458351023

Exactly like it!

UPDATE2

This is the result: https://www.facebook.com/emanuele.ricci/timeline/story?ut=64&wstart=1325404800&wend=1328083199&hash=-1081865809871332449

Perfect!


回答1:


Maybe I found something interesting.

This is the facebook documentation page: https://developers.facebook.com/docs/reference/dialogs/feed/#graphapicall

What I need to use is this:

properties

A JSON object of key/value pairs which will appear in the stream attachment beneath the description, with each property on its own line. Keys must be strings, and values can be either strings or JSON objects with the keys text and href.

I will experiment a bit and I'll post some results :)



来源:https://stackoverflow.com/questions/8933104/facebook-android-sdk-request-parameters-where-find-documentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!