当用户设置特定的预定时间时,我需要在页面上自动发布。 我尝试使用Graph api和以下请求:
Composer could not find a composer.json file in /var/www/html
但它给出了以下回应。
Bundle params1 = new Bundle();
params1.putString("message", "This is a system generated post");
params1.putString("scheduled_publish_time",(date.getTime()+(1000*60*30))""); //for current time to next 30 min
params1.putBoolean("published", false);
new GraphRequest(
accessToken,
"/850285671748182/feed",
params1,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
Log.d("Response-auto", "DATA" + response);
}
}
).executeAsync();
答案 0 :(得分:3)
您必须以秒为单位设置Unix TimeStamp。将当前毫秒转换为Unix Second的方法
Long unixsecond=Calendar.getInstance().getTimeInMillis()/1000L;