1

在我的 android 应用程序中,我想将视频从 android 应用程序分享到 facebook 墙。下面是我这样做的代码-

Request.Callback callback5 = new Request.Callback() {
                    public void onCompleted(Response response) {    
                        Toast.makeText(mContext,"Success",Toast.LENGTH_SHORT).show();
                        mDialog.dismiss();
                    }
                };
                File mFile = new File(videoPath);
                 Request request5;
                try {
                    request5 = Request.newUploadVideoRequest(session,
                             mFile, callback5);
                     RequestAsyncTask task5 = new RequestAsyncTask(request5);
                       task5.execute();
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                }

还在 fb api 控制台中进行了更改。但是上传视频时-

{Response:  responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) Requires extended permission: publish_actions}, isFromCache:false}

编辑:我添加的权限-

            `   Session s = new Session(mContext);
                Session.setActiveSession(s);
                s.openForPublish(new Session.OpenRequest(PostVideoToFBWall.this).setCallback(callback).setPermissions("public_profile","email","publish_actions"));`

在此处输入图像描述

4

0 回答 0