我在 Twitter 上使用 Gigya 共享媒体文件时遇到问题。请看下面的代码片段。它给出的错误代码为 0,但在帖子中,只有文本被发布。
private void share(){
GSObject userAction = new GSObject();
userAction.put("title", "Text");
GSArray mediaItems = new GSArray();
try {
mediaItems.add(new GSObject("{\"src\":\"http://www.f2h.co.il/logo.jpg\", \"href\":\"http://www.f2h.co.il\",\"type\":\"image\"}"));
userAction.put("mediaItems", mediaItems);
} catch (Exception e) {
e.printStackTrace();
}
GSObject params = new GSObject();
params.put("userAction", userAction);
params.put("enabledProviders", "twitter");
GSAPI.getInstance().sendRequest("socialize.publishUserAction", params, new GSResponseListener() {
@Override
public void onGSResponse(String method, GSResponse response, Object context) {
if (response.getErrorCode() == 0) {
Log.d( "Twitter Auth Token","Session token Response Error ");
} else {
Log.d( "Twitter Auth Token","Session token Response Error "+response);
}
}
}, null);
}