Facebook scenario - is this possible? - facebook-graph-api

I'd like to know if the following is possible using Facebook apps:
I'm using the Facebook SDK for .NET and want to create an app that a page will use. The app will take a photograph from a user who happens to visit the page, that photograph should then be sent to one of the page's photo albums.
I've managed to perform this successfully, but only when logged in as the page admin. If I log out of the page admin, log in as my personal Facebook account (as most users of the app will do) then the photograph never gets sent to the pages photo album.
I would like to do all of this when the user uploads the photo, but if it isn't possible I'll need to look into a separate process to actually send the photo's to Facebook, and just store the image on my server until the process runs.

The admin photo album (aka page photo album) is not the same album as non-page admins get to upload to (which is the wall). They are separate buckets all together.
As you mentioned, you can always just upload and store the photos on your server, and then just have a feed item that links over to that image.

Related

Fetch users media using the new Instagram Graph API on WordPress

Soo.. with the new changes that Instagram and Facebook have brought upon us, it has made it more complicated to have a module displayed on our website to just show the images from a user's feed.
Long Story:
Below, are the things that I have already accomplished:
- Create a Facebook page and link Instagram account (Completed)
- Create an Facebook App (Completed)
- Create a Business Manager page (Working on verifications)
I want to be able to display a users profile images depending on the username that is set in a custom field type on WordPress Admin Panel.
Questions:
Since we own all of our corporate IG accounts, do I have to implement Instagram/Facebook login to display user's feed items?
Is there a way to bypass this?

Missing photos in Google Admin Directory Users response

I'm using the Google Admin Directory Users endpoint to retrieve all the users in our company's domain. The request is working as expected and I'm receiving the full list of users.
But a large number of users are missing photos. The thumbnailPhotoUrl property is present on each user entry, but following the URL leads to
https://ssl.gstatic.com/s2/profiles/images/silhouette200.png
which is the default avatar, for a large number of our users.
However:
If I go into Inbox and send one of the users showing the default avatar an email, their profile pic appears when sending the email
And when the user logs in to our app using their company email (using
Firebase Auth), their user response contains a public URL for their avatar
And if I log in to G Suite Admin and view our users, the majority of them have avatars. Only a small handful of users show the silhouette avatar.
Also, the docs state:
Note: In this version of the API, a photo is the user's latest Gmail Chat profile photo. This is different from the Google+ profile photo.
From the accounts we've viewed, all users have Gmail Chat/Hangout profile photos.
So it seems the users have photos associated with their account. Why are the photo URLs in the Google Admin Directory showing the default avatar? And not the user's uploaded photo?
I ran into this today and found your question while trying to solve the problem. I think I have the answer!
The thumbnailPhotoUrl property in each of the user profiles that leads to silhouette200.png starts with https://www.google.com/s2/photos/private/ followed by a long id string.
On the other hand, any user profile that returns a valid photo (instead of redirecting to the default/anonymous photo) starts with https://www.google.com/s2/photos/public/ ... like my Google Apps/G Suite profile photo.
I discovered fairly quickly that if I am logged into my G Suite account in the browser where I try to view those thumbnail photos, they resolve as expected with actual photos instead of silhouette200.png.
So: to display G Suite user photos in a custom app, the app user needs to be logged in with a G Suite account that is authorized to read other G Suite domain users' private thumbnail photos
or
your app will need to proxy the photo request in order to return the actual thumbnail.
Of course, please do consider user privacy expectations and
regulations; the fact that the profile photo is private usually
indicates that the user did not set their own profile photo but had it
set by some external application or sync process. (As far as I can tell, when a user
sets their own profile photo using My Account or About Me,
it is always made public.)
Adding some documentation reference to help define the ultimate purpose.
Google API part is here.
Parameter viewType() defines what part of the user profile is returned which in turn depends on GSuite Directory settings. This parameter also defines the level of
authorization when using the Google API.
When using a third party app as defined here, more elements come into play.
In the end, thumbnails appeared...

Is it possible to display Facebook user photos if someone isn't logged into Facebook?

I'm in the draft stage of designing a charity site for a friend of mine, and we'd like to be able to display photos of people who donate (they would have the choice of turning their photo on or off).
I'm used to logging people into another app of mine via Facebook, and retrieving their basic data.
What I'm wondering is - since the person viewing the site would be the only one logged into it, is it even possible to display photos of Facebook users who have donated ie can you retrieve a FB user photo if they aren't logged in?
If not, are you allowed, with the user's permission, to store their Facebook photo?
Thanks for your time and help.
Have a look at
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/picture/
It's stating
Because profile pictures are always public on Facebook, this call does not require any access token.
This means as long as you requested the public_profile permission upon Facebook Login, and stored the app-scoped user_id in your database somewhere, you can use this app-scoped user_id to generate the profile picture image sources as follows:
<img src="https://graph.facebook.com/{app_scoped_user_id}/picture?type=large&redirect=true"/>
and replace {app_scoped_user_id} by the real app-scoped user_ids in some kind of loop.

Share large photo from FB album

I'm creating a web app where I'd like to 1) upload a photo to an app-specific album on Facebook and then 2) share that photo as a LARGE item/image (not a thumbnail) on the users' Timeline. I know this is doable via User Generated Photo optional parameter but is there any other way to accomplish this for a web app?
There is nothing stopping web apps from publishing Open Graph actions with User Generated Photos. It's a simple process:
Setup Facebook auth on your site, your simplest option being to use the Javascript SDK with getLoginStatus. Make sure to request publish_actions permission from users.
Create an Open Graph action and your OG object types
When the user takes the appropriate action, make an API call of the following form (signed with the user access token and POST'd):
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_APP_ACTION?
YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&
image[0][url]=YOUR_PHOTO_URL&
image[0][user_generated]=true
Step 1 is the hardest part and you'd have to do that anyway if you weren't going down the Open Graph actions route.
As an example, Instagram use took as their action and a photo as their object. Their objects URLs are simply the individual photo pages on the Instagram website. So their API POST call would look like this:
https://graph.facebook.com/me/instagram:took?
photo=http://instagram.com/p/ABCD1234/&
image[0][url]=http://distilleryimage.instagram.com/somerandomstring.jpg&
image[0][user_generated]=true
As mentioned in the User Generated Photos documentation this will show up as a large, full-width photo on the users Timeline and feed.
The simplest way to perform all these API calls from a web app is to use the Javascript SDK and the FB.api function. You won't need to use any server-side code at all in that case!
Just fill this code on your photo caption
"took a ##[0:[124024574287414:1:photo]] with #[124024574287414:0]"
(without double quote symbol)
It clickable to instagram website, It's my own custom code, I made it for a week :(

Photos uploaded to Facebook Page via Graph API cannot be tagged on Facebook (website) by non admin users

If I upload images to an album on my facebook PAGE (not profile) via facebooks website then other (non admin) users of that page can tag themselves in the photos. I have set that up in my page preferences.
"Posting Ability: People can add tags to photos by (PAGE NAME)"
However if I use the GRAPH API to upload the photos to an album on my facebook PAGE then only admin users can tag themselves. I am sure this was not always the case.
Here is an example of two images in the same album, one can be tagged the other not!
Image uploaded by the api:
https://www.facebook.com/photo.php?fbid=310796772303725&set=a.310794905637245.113595.170367249680012&type=3&theater
Image uploaded via the facebook website:
https://www.facebook.com/photo.php?fbid=342651955784873&set=a.310794905637245.113595.170367249680012&type=3&theater
I would be very grateful if anyone could let me know why this is happening
The solution is rather simple. The non-admin user must have Liked the page before they can tag someone. I Liked your page and I had the option to tag users in both images...