I need to execute the publish methode with an unknown number of parameters. Each attachment needs to be added using ...
Parameter.with("attached_media[i]", ...
but the number of attachments can change. How do I dynamically add parameters in this call?
GraphResponse publishMessageResponseMSg =
facebookClient.publish("me/feed", GraphResponse.class,
Parameter.with("message", msg),
Parameter.with("published", "false"),
Parameter.with("scheduled_publish_time", timeStampStr),
Parameter.with("attached_media[0]", "{\"media_fbid\":\""+ publishMessageResponseImg1.getId() +"\"}"),
Parameter.with("attached_media[1]", "{\"media_fbid\":\""+ publishMessageResponseImg2.getId() +"\"}"));
This is rather simple, you can put an array directly into the
publishmethod.