Sharing an image link at the time of upload to facebook - facebook

For a variety of reasons I won't go into, I am unable to upload photos to a user's FB account from a standalone kiosk application.
As an alternative what I would like to try is
1- the user logs in to their FB account with name & password
2- the photo gets uploaded to one common admin account,
3- just the link to this uploaded photo gets posted to the user's feed.
So in essence there would be 2 login + uploads.
The first would be hidden from the user and have the hardcoded email+pw for the common admin account. The photo would be uploaded here.
The 2nd would be the one the user sees and would control just the posting of the link to the previously uploaded photo.
Can any facebook experts chime in and suggest whether this is possible?
I am using a local node.js,passport, express server to handle login and authentication.

Related

Is it possible to use a self expiring photo through a link to a 3rd party server as a social media profile picture?

Suppose I have developed an app that creates encrypted images with a self expiring link that can only be opened through browser, and I want to use such service to have temporary profile picture say on facebook.
When I use Devise and OAuth in a web app, every time user signs in, e.g. with facebook credentials, it retrieves an image through a link from facebook server (of course you can optionally save the image on the app's server). I wonder if a reverse mechanism can be used to ask facebook to use a certain link for profile photo, and if nothing is available just uses a default profile photo.

Permissions needed to upload photo for a Facebook app

There seems to have been a huge change in the way Facebook manages apps that access their API. Now it seems if you want to create any app that allows uploads to Facebook this application MUST be reviewed by Facebook. Am I wrong? has anyone actually managed to speak or correspond DIRECTLY with anyone at facebook to confirm this?
So my question is, after a week of hair pulling and trying to get a simple image uploading application working, what permissions are necessary to upload a photo to facebook?
Right now I have
publish_actions
email
pubic_profile
user_friends
I'm guessing I ALSO need user_photo permissions.
But the convoluted process that is required to add more permissions has me stumped.
First i click new submission. Then I select user_photos. But I then get an error saying 'It looks like you haven't made any API requests to access content with the user_photos permission in the last 30 days. You need to test this permission in your app with any account listed in Roles before you can submit for review. It looks like you havent tested this permission because no API request has been made against publish_actions in the last 30 days.
Which seems INCORRECT to me since in my signed GET request for image uploading I see the following
redirect_uri fbconnect://success
display touch
state {"is_open_session":true,"is_active_session":true,"com.facebook.sdk_client_state":true,"3_method":"fallback_auth","0_auth_logger_id":"foo"}
scope ****user_photos****
Ok, can any Facebook API experts confirm that
1) I definitely need to submit my app for review in order to upload photos to a facebook account
2) I need user_photo permissions
and
3) I must first set up a test user and test with user_photos BEFORE I submit the app
Addendum. After further testing am getting the image upload to work for all users, BUT only after logging in a 2nd time. ie after first login submit the user is presented with a new blank login popup. Only after logging in a 2nd time (the photo upload is done immediately after login) is the image uploaded successfully.
Can anyone suggest why this is happening? I've posted a 2nd question here
Facebook Image Uploads-required to login twice for first upload
do this and you problem will solve
go https://developers.facebook.com/tools/explorer/
select your Application and get access token and put this in field of submit "me/photos?fields=album" and press on submit >
that is done . that requests API to access content with the user_photos permission ..
Also can do that for every permission need to API requests just with some chage ...etc
It should be clear from the docs what is necessary and what not. I think I already answered questions 1) and 2) in your other question:
Latest Facebook Graph API > only admin user can login-upload photos
I doubt that 3) is necessary, because according to the docs user_photos is needed to retrieve photos, and publish_actions to upload photos...
References:
https://developers.facebook.com/docs/graph-api/reference/user/photos/#Reading
https://developers.facebook.com/docs/graph-api/reference/user/photos/#Creating

Upload one photo to Facebook fanpage

I'm using this tutorial http://pastebin.com/WpJmPYAi, and with some changes I can upload a photo to my fanpage.
But, I want to be able to upload when I'm logged out from Facebook. In my website, I need to be able to upload images to the fanpage without my account login.
Is this possible?
For example, I think: Is there any way to do this:
$page_info = $facebook->api("/".$fanpage."?fields=access_token");
Without a facebook accounts logged in, only with my app and accounts data.
You can set a stored access_token using the Facebook::setAccessToken($access_token) method.
See the PHP SDK documentation for details: https://developers.facebook.com/docs/reference/php/facebook-setAccessToken/

pyrocms social module: how to register new user with facebook connect

I'm still new to CI and PyroCMS, and am trying to implement a Facebook login using the Social module in a custom module, which looks like it does everything I want, but I'm clearly missing some basics (I can't find any documentation other than the brief readme)!
So far, I've watched the intro video, and have enabled Facebook successfully. I can connect via FB and see FB listed in /social/linked, but some confusion exists in my mind between the two user groups I've got: admin and user.
The flow I'm trying to construct is:
user arrives at the site and is presented with a survey
user fills in the survey, then is asked to signup (I understand that this is unconventional)
/signup has a facebook connect button, supplied by the social module
user clicks the connect button, and grants permission in facebook's popup window
user should be directed back to /signup, (or maybe redirected to /user/registration) with some details filled in from facebook (eg. email, name)
on submit, user should be added to the users table, as a member of the 'users' group (not admin) with no email activation required
an email is sent, thanks page is displayed
on returning to the site, the user should access their on-site profile using facebook connect.
I've read a bunch of threads on the subject, which have shaped these expectations...
Here's where I'm at:
user arrives, fills in survey, clicks the connect button
user is redirected to the homepage, which displays a standard page (not handled by my module). I need to return to /signup!
Based on this, I've tried setting:
$this->session->set_userdata('redirect_to', '/signup');
in what I believe is the correct controller method (checks to see if the user is logged in before sending the email, then calls template build to display the social buttons), to no avail.
(edit: I now see that the code above relates to the user module, not the social module.. maybe i can transplant some changes...)
My questions:
am i on the right track, or going about this the wrong way?!
am i right in thinking that the FB account will be matched with an existing user if the email addresss exists in the system?
I have only one FB account, which I is authorised for the app, and I'm using to connect with as a user - will this work, or do I need a separate FB account to test as user?
Other notes:
I am testing the site in Chrome, logged in as admin in Firefox.
Facebook is my testcase, I'm looking at supporting FB, LinkedIn, google and Twitter eventually.
Phew! Grateful for any feedback, Tim
I will try to answer some of your questions since i'm currently experimenting with the exact same social module as well and with some addons to it.
am i right in thinking that the FB account will be matched with an
existing user if the email addresss exists in the system?
Yes you are. I checked it myself while troubleshooting the fact that my google (gmail address) could'nt connect while my hotmail (registered email) could. You will have to sync your emails in all your social sites, change the loginsystem (allowing username login for example) or manually connect multiple emails in your account settings..
I have only one FB account, which I is authorised for the app, and I'm using to connect with as a user - will this work, or do I need a separate FB account to test as user?
I suggest u let someone with another FB account test the system (better save then sorry) but in my case I didn't have any troubles using other (normal) accounts to log in.
am i on the right track, or going about this the wrong way?!
This was your first question, but I'll answer this as the last on since I didn't test is myself:
The Facebook App has a setting called "Site URL". This is the url to which will be redirected. Simply change it to the page you wish it to be. You can also try to change the following lines in social/controllers/social.php:
Line 245 (redirect: user is logged in after FB connect)
redirect($this->input->get('success_url') ? $this->input->get('success_url') : 'social/linked');
Line 283 (redirect: user has to fill in some additional fields to complete registration)
redirect('users/register');
Good luck!
The intro video shows off the entire extent of the social module. Frontend registrations, frontend user account linking, and backend account linking for the entire system.
If you wish to integrate custom functionality, custom user flows and other stuff as listed in your question then you will need to do a little custom work with the module. Hack it, extend it, send in some pull requests, whatever, but sadly it cannot do "everything to integrate with everywhere ever" out of the box. :-/

Uploading Photos to Facebook using Graph API

I would like to provide users of my application with ability to upload photos to their Facebook account. The application has a username and password form for the users to fill.
In Graph API, there's a method for uploading photos. But I'm unsure how to authenticate - it doesn't seem to provide a way to supply username and password. It requires access_token.
What's the right way to allow users authenticating and uploading photos using username and password?
It's hard to tell how you want to do this without a sample code or even stating what technology you are using..
Anyway, almost ALL interactions with facebook graph api require an access token and most likely an extended permission.
First of all, for you to post/upload a photo you need:
The publish_stream extended permission
A better understanding of how and where the photo will be uploaded to, this can be done by reading the publishing section in the photo documentation
Now that you have a general idea, in your destination/submission page of your form and when the image is successfully uploaded to your server and it's location is known (obviously), use one of the two answers in this question to upload the image.
P.S: I don't really understand why you need a username & password in first place, but it's your application...
To clarify, the access_token is what you receive after the user authorize your application. So , the provision of username and password only need to be done once, when user first access your app.
You need to redirect user browser or client to : https://www.facebook.com/dialog/oauth... (Refer to https://developers.facebook.com/docs/authentication/ )
Then after you have the access_token, you can just use that for the api call to upload photo to that user.
The authorization process need to be done again when the token is expired.