Facebook Stream.publish permission based on connected environments

I am creating an application that uploads photos to Facebook and then adds a link to the user's wall. I would like to know if the same visibility permissions can be assigned for publication as a photograph or a photo album onto which it is uploaded. I easily get visibility permissions from the album.

Is it possible to install the same resolution on a wall, and if so, how?

Clarification: I do not mean client-side permissions for the actual file. By permissions, I mean the "visibility" tag passed from the getAlbum (s) API. (i.e. Visibility: everyone, friends, custom, etc.)

Thus, if the user sets an album that will be displayed only for his friends, and they decide to take a photo uploaded to this album, when connecting the photo in the stream (wall), it has the same visibility as the album in which it is located.

Example: Joe creates a Facebook photo album called Summer Fun, which is visible only to his Friends. Joe uses my app to upload photos to the Summer Fun album. I check the Visibility field of the album and see that it is set to Friends. Joe also wants the link to this photo to be posted on his wall, in which my application can easily make using the stream publishing API. Due to the privacy setting of the Summer Fun album set to Friends, I would like my app to respect this setting when posting to the wall. Creating a wall post is visible only to the same group of people that he calls his "friends."

In other words, is it possible to ask a group of people who can see the wall post programmatically, as if you were in the small "Share" folder on facebook.com and set it only to "Friends"?

  • Language: PHP5
  • Usage: Facebook REST API, cURL, however open to alternatives, if necessary, to get the final result I need.
+4
source share
2 answers

Jayrox, it seems that it is currently not possible to set the visibility of wall posts programmatically.

Quote:

If you want to display the content a user created, check the privacy for the content by querying object_id in the confidential FQL table or by calling privacy.get .

If you extract the privacy settings that the user assigns to his album, you can then assign the same privacy settings to the wall after Stream.publish

In addition, the user can configure what appears on his wall using the application settings, and can control who can see his wall through his Privacy Settings; applications do not have the ability to change the visibility of wall posts (even if it limits the visibility of even fewer people than usually allows privacy settings).

In other words, the user can control who can see his wall and what he can write on his wall, but he cannot set the visibility of certain wall posts. If he is hung on the wall, this is visible to those who can see his wall posts.

However, there is one interesting question: if the user has a group of people who can see their wall but cannot see his notes, will these people:

A) Be able to see wall posts about new notes, but cannot view them

B) Do not automatically see wall posts about new notes.

If the answer is B , then you should be fine, as the user's privacy settings will take effect automatically.

Cm:

http://www.allfacebook.com/2009/02/facebook-privacy/

http://www.insidefacebook.com/2009/04/28/first-look-publishing-data-to-the-facebook-stream-using-the-new-stream-apis/

http://wiki.developers.facebook.com/index.php/Stream.publish

http://wiki.developers.facebook.com/index.php/Extended_permissions/Stream_permissions

+2
source

If you want to just upload photos to facebook use this:

Download this facebook_php5_photoslib library first

Then use this code

<?php require_once 'facebook_api/facebook_php5_photoslib.php'; $appapikey = '[YOUR KEY]'; $appsecret = '[YOUR SECRET]'; $facebook = new FacebookPhotos($appapikey, $appsecret); $user = $facebook->require_login(); $appcallbackurl = 'http://eyermonkey.com/FlickrTools/'; //catch the exception that gets thrown if the cookie has an invalid session_key in it try { if (!$facebook->api_client->users_isAppAdded()) { $facebook->redirect($facebook->get_add_url()); } } catch (Exception $ex) { //this will clear cookies for your app and redirect them to a login prompt $facebook->set_user(null, null); $facebook->redirect($appcallbackurl); } // Get a list of the users albums $albums = $facebook->api_client->photos_getAlbums($user, null); // Pick the first album for sake of the example $aid = $albums[0]['aid']; $filename = 'http://eyermonkey.com/FlickrTools/test_image.jpg'; $caption = 'IM IN UR C0D. UPLOADING UR FOTOS!!1!'; // Perform the upload and get the return data (including the URL of the new photo) // You can do what ever you want do with that url $upload_result = $facebook->api_client->photos_upload($filename, $aid, $caption); // See the data that you have access to now that the photo is uploaded echo '<pre>'; print_r($upload_result); echo '</pre>'; ?> 
0
source

All Articles