I have integrated fb and g+ login for my ios app. and If phone already sign in with the fb its automatically log in when click the fb button. But I want to send the email of the user in fb and g+ to the server separately. Can anybody tell me how can I get the email from fb and g+ both.
Thank you
You won't get any user data (profile, birthday, email, etc.) without requesting specific permission from the user. It's a matter of following the SDK guide really.
You can request a user's information by making a me request. And you can do this in two ways:
Using the FBRequestConnection startWithGraphPath:completionHandler: method, like you did in the requesting permissions section, and setting the path to me.
Using the FBRequestConnection startForMeWithCompletionHandler: method, which will make a me request directly.
https://developers.facebook.com/docs/ios/graph
It's hard stuff that you will need to go through as a developer. Following how others did it by code will help you. But reading through the SDK guide will make you understand better.
Related
I'm working on a facebook app that posts newsfeed ads, and I have been banging my head against the wall for the last few days, the work flow should go like this:
User provides his page id.
The App requests authorization to post ads on the page. stuck here
App verifies that the user authorized it.
App creates adcreatives using the user's page_id in the object_story_spec call to /adcreative using the app's ad account.
I went through How to post to page as an app?'s docs, couldn't figure it out.
the app is written in Go, however if you can provide a code sample it doesn't matter what language you use, I just need the basic work flow.
Not sure what you want to do exactly, but if you want to create ads (for am ad_account/user) via an app, you'll need the ads_management permission during Facebook Login.
How you manually create a login flow can be found in the docs as well.
See
https://developers.facebook.com/docs/facebook-login/permissions#reference-extended
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
I want to automatically download user's profile photo from Facebook from within iOS app when an email is provided. I'm doing it by performing search to get user id.
The app will be used by many people, so there shouldn't be logged user, eventually app should authenticate itself.
My problem is getting access_token to do that. Similar solution is implemented in the Sparrow (email client for OSX and iOS).
My guess was to acquire an access_token by making request with this url:
[NSString stringWithFormat:#"https://graph.facebook.com/oauth/access_token?client_id=%#&client_secret=%#&grant_type=search", appId, appSecret];
but in return i'm getting this:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
anyone knows how to solve this?
You need a user access token to be able to search by email address; see Find Facebook user (url to profile page) by known email address.
In work I got a task (we MUST work with ASP Classic by the way): when user posts a blog, a link to that blog should be posted automatically on user's facebook timeline and in his twitter. I made everything working, but there is one problem: user needs to be signed in to post. I've made the cheking if he's logged in, and if not he must log in.
But I need to avoid the logging-in step and make it automatic (by sending user's username and password as part of the data sent to twitter/facebook or something like that), but I can't figure out how to do that or if it's even possible at all.
Any ideas? Would greatly appreciate any help.
P.S.: for the twitter part I used http://scottdesapio.com/VBScriptOAuth/
for the facebook part I used a combination of: http://snipplr.com/view/61108/facebook-app-login--authorization-entirely-clientside/
Everything works, but is it possible to automatize the user's sign-in part?
Finally I managed to make the both things automated...
The problem with Twitter was that I didn't store request token in session, that's why I got "Could not authenticate you" error.
Can't remember what I did wrong with Facebook (some co-workers helped me out), but I guess I didn't make proper http requests...
So the answer is: yes, it is possible to automatically post to Twitter and Facebook without user sign in.
If I am not wrong then your logged in user in facebook for current browser is not authorize for your app.
I think you should try googling about "How to authorize users into app". OR
If you don't mind I am giving you the direct URL to go to that setting page for your app:
https://developers.facebook.com/apps and then go to your app then after from left side bar go to roles and then after click on test user tab from top of page and then click on add button it will opne one pop-up to add a user.
In app you have to add test user for testing purpose and have to login for that added test user, so added user will be authorize for that app and you will be able to test.
Thank you...
I've been trying to figure out a way to have my iframe Facebook app (built in PHP) work without requiring separate authentication methods. I am already logged into Facebook, but for some reason I still see all these Oauth notices from the example in the PHP SDK.
The only data I need is publicly available even without them "adding" my app. I am looking to collect their Facebook ID (since this is a contest, we need a unique ID for tracking), their name and (optionally) their email address as well.
The problem is, I cannot use the API to fetch the public information unless I already know their Facebook username. Any ideas on how I might be able to get their logged-in username or public handle so I can then fetch the rest of the information?
For whatever reason, Oauth is driving me completely insane with Facebook today.
Sidenote:
I did manage to technically get the Javascript SDK operational, which fed some information to PHP for use. The only issue there is that once I login, I don't see the data. If I refresh...then it shows up. Unsure why the refresh is required, as I wouldn't expect a user to actually have to hit refresh in order to proceed with the app.
I guess you are a bit confused here, Facebook will NOT share the username, id, full name or email without the user explicitly authorizing/allowing your application (and in the case of the email, requesting the email permission!).
Read the official Canvas Tutorial for more information:
In order to gain access to all the user information available to your
app by default (like the user's Facebook ID), the user must authorize
your app.
I would like to post updates to Facebook from my iPhone application. I know that there is a Facebook Connect project, but it requires displaying dialogs for entering user's credentials, dialog for posting content, etc. I would like to be able to get the credentials from application settings and post whatever the user put into UITextView.
Is it possible? or am I stack with Facebook Connect?
Thanks!
You need to use Facebook Connect to authenticate and let the user set privacy settings for your app on their profile. You might technically be able to write all the authentication code yourself (see Facebook's Developers page about authentication) but why bother when the experts have done it for you?
You can then use the Facebook Connect API to do whatever you need to do with Facebook, assuming the user has give your app permission to do so.