1

hi i am trying to upload images from my wp8.1 app to facebook but one of the issues is that pictures posted are visible to only me unless i amnually change it from facebook . i want to post them automatically for public to view . here is my code :

 var postParams = new
        {
            access_token = ObjFBHelper.AccessToken,
            message = "My message",
            source = pic,



        };

  try
     {
       dynamic fbPostTaskResult = await    fbclient.PostTaskAsync("me/photos",postParams);
     var responseresult = (IDictionary<string, object>)fbPostTaskResult;


        }
        catch (Exception ex)
        {
            //MessageDialog ErrMsg = new MessageDialog("Error Ocuured!");

        }
Refilon
  • 3,334
  • 1
  • 27
  • 51
Kam
  • 109
  • 7

1 Answers1

0
var parameters = new Dictionary<string, object>
{
    { "message", FacebookMessage },
    { "privacy", new Dictionary<string, object>
        {
            { "value", "ALL_FRIENDS" }
        }
    }
};

I found this on stackoverflow. Maybe it helps you too?

From: SO question

Community
  • 1
  • 1
Refilon
  • 3,334
  • 1
  • 27
  • 51
  • when i upload any picture from my laptop it gets public while any pic from my app gets as only to me so how can change it. do i need to send some permission ? – Kam Feb 18 '15 at 11:59
  • var postParams = new { access_token = ObjFBHelper.AccessToken, message = "My message", source = pic, privacy = ALL_FRIENDS, }; it gives an error that all_friends doesn't exist in current context – Kam Feb 18 '15 at 18:37
  • @Kam, please have a look at my updated code. Maybe you can adjust it, and it will work :) – Refilon Feb 20 '15 at 15:34
  • You can accept my answer as correct one if it helped you :) – Refilon Feb 24 '15 at 08:08