after login with google and facebook not returning back in ios 7 - ios7

As per title in my app i can successfully login with facebook or google account as per tutorial given in developer.facebook.com and developer.google.com but problem is that flows not return from browser to my app.

Did you configure your project's URL Schemes correctly in your info plist?
https://developers.facebook.com/docs/ios/getting-started#configure
The login calls a custom URL that your app has to handle after the authentication is done

Related

Get long access token from instagram mobile app

I'm using `
https://api.instagram.com/oauth/authorize?client_id={{ instagramAppId }}&redirect_uri={{ redirectUrl }}&scope=user_media,user_profile&response_type=code
` url to verify user via instagram api.
Is it possible to get access token from instagram mobile app? The web view with insta login needs credentials to login, even though user is logged in mobile app.
Thanks!
Webviews keep their own cookie jars, so you have to log in separately. You can't use the mobile app's tokens. You can open the login page in a browser instead of a web view. Then, if the user is already logged in to Instagram in this given browser, you will instantly get a response from the authorization endpoint. Still, the user needs to be logged in in the concrete browser, being logged in in the app won't help.

Firebase auth Redirect to Facebook app instead of website for login on mobile

Is it possible configure my firebase project so that if a user is on mobile and they need to log in, they are redirected to the facebook mobile app instead of the facebook website in their browser?. I thought iOS would automatically intercept the link but it just takes you to the facebook site. Users with the app installed might not already be logged in through their browser since they are used to using the app and i'd like to avoid the extra login step for them

Facebook Login Using UIWebView

My app was rejected by Apple because "Login via Facebook" opens the Safari app, because I am using UIWebView for Facebook login, which is working fine. I am getting the access token as well.
The problem is I also need user information like user ID, email ID, user name etc. because I need to save it on my server.
How do I get the logged-in user's info when I have the access token?
Have you read the FB iOS documentation?
https://developers.facebook.com/docs/reference/ios/current/
There is an API called FBRequest which can retrieve various information or the Graph API can be used to obtain stuff.
How to integrate FB login with an iOS app is fully documented with example projects.

How to implement Devise Login with Facebook for Mobile Device

I have to write an API for mobile device to implement Login with Facebook using Devise. I have done the web implementation and the as per my research the Facebook Login flow works as follows:
Step 1:
The user comes on the website and clicks Login with Facebook. It hits the facebook verifying the permissions for the app.
Step 2:
If the user accepts, facebook hits the web application with a temporary code.
Step 3:
The web server using the temporary params code hits facebook again to get the user's access token.
Step 4:
Facebook hits the web server with the user's access_token which is saved by the web application in the database. If the user with the access_token already exists then a new session is created else a new user record is created.
This is the complete flow of login of Facebook for a web application.
Now when writing mobile api for a Mobile device the question comes is:
Will the mobile device hit the web application with the facebook's temporary code as mentioned in Step 2 and the Web server will hit facebook using the temporary code to get the user's permanent access_token?
OR
Will the mobile devise hit the web server with the permanent user's access_token from facebook which is then identified for its existence in the database by the web application?
Please Help.
Many Thanks!!
Did you saw Devise + Facebook OmniAuth integration?
I used this integration and it uses the step 2, it's very easy and you don't have to care about this issues, it's already done.

Redirect to own site when user logs in via Facebook app

I am building an app with the functionality to publish
messages to users walls while specific actions runs on
my website.
What I have done is (briefly):
Registered my own app on Facebook
Added a login button on my website with permission
to publish:
Log in on Facebook
Downloaded facebook-php-sdk library
It is now I start having problems. I do not know how
to do what I want to do now.
What I want to do:
When a user logs on to facebook via my website. I want
a file on my site to be called, where I can update the
user's data in my own database as well.
Because that is not what the canvas url is meant to do? How it
is no, seems no file at all is called on my site when
I click on Login.
Since you are using the Facebook PHP-SDK you noticed that there are two options for the users to login:
Using the XFBML button, which will:
Open a login dialog (pop-up) asking for permissions..etc
When a successful authentication/authorization is complete the dialog will close, the auth.login event will be triggered and based on that the page will get reloaded window.location.reload();
The PHP in the top of the page will get into business and $session = $facebook->getSession(); will actually retrieve a session! $user = $facebook->getUser(); will retrieve the current user
Using the Login URL generated by the Library $loginUrl = $facebook->getLoginUrl(); this URL will get you through the same flow and if you noticed there's a next redirect_uri parameter which will redirect you back after a successful process to that URL (mainly the same URL you are at), where you can change that parameter if you like.
The canvas URL is the URL Facebook uses when it displays your application from within Facebook. You would use this functionality if you expect users to use your application while in Facebook itself.
When authenticating using Facebook's API (assuming graph API usage here), you provide a redirect_uri as part of the authentication URL. Once Facebook has authorized your application, it will redirect the user's web browser to the URI you specified. This URI can be any link you desire on your site. You should use the link as the determination of when the user is logged in successfully, e.g., https://mywebsite/facebook/loggedin.