Why my code not work to upload the Photo on Facebook from in android?

后端 未结 1 1437
悲哀的现实
悲哀的现实 2021-01-16 23:02

I have integrated the Facebook-sdk successfully in to my appplication. Now i am going to share a photo to Facebook. To do that I am using this code:

facebook         


        
1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 23:35

    Depending on what you want to do, you need to give a target (first null) to this line of code:

    mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
    

    For example, if you're trying to make a post on the current users wall, it should look like:

    mAsyncRunner.request("me/posts", params, "POST", new SampleUploadListener(), null);
    

    You will need the correct permissions to do this: at least publish_stream.

    See docs

    0 讨论(0)
提交回复
热议问题