Facebook的API 3.0。 - 添加包信息图片上传 [英] Facebook API 3.0. - Add bundle information to image upload
本文介绍了Facebook的API 3.0。 - 添加包信息图片上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用FB API 3.0 Android版,并根据实例第一节使用
I'm using FB API 3.0 for Android, and according to examples for Session I use
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback();
要上传的图片。 我需要添加一些默认的文本到这个形象,但我想不出哪里把它。
to upload the image. I need to add some default text to this image, but I can't figure out where to put it.
在旧的API有参数的包被发送的:
In old API there was a bundle of parameters that were sent:
params.putByteArray("picture", imgData);
params.putString(Facebook.TOKEN, accessToken);
params.putString("caption", MyGlobals.INSTANCE.activeSetting.f_name);
什么是正确的方式来增加文字,请求为newUploadPhotoRequest?
What is the proper way to add text to Request for newUploadPhotoRequest?
TNX。
推荐答案
在创建请求,并执行它之前,你可以做到以下几点:
After you create the request and before you execute it, you can do the following:
// 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);
这篇关于Facebook的API 3.0。 - 添加包信息图片上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文