我正在为 Android 使用 FB API 3.0,并且根据我使用的 Session 示例
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback();
上传图片。 我需要为这张图片添加一些默认文本,但我不知道该放在哪里。
在旧 API 中,发送了一组参数:
params.putByteArray("picture", imgData);
params.putString(Facebook.TOKEN, accessToken);
params.putString("caption", MyGlobals.INSTANCE.activeSetting.f_name);
将文本添加到 newUploadPhotoRequest 请求的正确方法是什么?
谢谢。
最佳答案
在创建请求之后和执行之前,您可以执行以下操作:
// Get the current parameters for the request
Bundle params = request.getParameters();
// Add the parameters you want, the caption in this case
params.putString("name", "My Caption String");
// Update the request parameters
request.setParameters(params);
// Execute the request
Request.executeBatchAsync(request);
关于android - Facebook API 3.0。 - 为图片上传添加 bundle 信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13083419/