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

当用户设置特定的预定时间时,我需要在页面上自动发布.
我尝试使用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 TimeStamp.以下方式将当前毫秒转换为Unix秒

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

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...