gpt4 book ai didi

android - 如何在给定的预定时间自动在 Facebook 页面上发布更新?使用安卓

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:51:53 24 4
gpt4 key购买 nike

当用户设置特定的预定时间时,我需要自动在页面上发布。我尝试在以下请求中使用 Graph api:

    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();

但它给出以下响应。

{"error": {"message": "(#100) The specified scheduled publish time is invalid.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "HcuHy8cusGC"}}

最佳答案

您必须设置以秒为单位的 Unix 时间戳。下面的方法可以将您当前的毫秒转换为 Unix 秒

Long unixsecond=Calendar.getInstance().getTimeInMillis()/1000L;

关于android - 如何在给定的预定时间自动在 Facebook 页面上发布更新?使用安卓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42364114/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com