Not automatically login to Google+ using UIWebView (iOS)? - ios

I have a question about authentication with UIWebView.
I want to login in webview in plus.google.co
I sign in in google plus one time as shown in
https://developers.google.com/+/mobile/ios/sign-in
When user go to google+ page again in UIWebView then program should be automatically
logged in and save the user's session. But in fact it is not keep logged in.How can i keep user logged in for google+ although user is one time sign in for Google+ in my application.
I also checked condition for this as :[[GPPSignIn sharedInstance]
authentication] and it return true that i am logged in already.but when i checked in uiwebview by pushing new ViewController then it ask me to sign in.
And When i open plus.google.com in safari in iPhone then it show me
as a login user.
I searched a lot but can not find an answer.please help me out from
this.

If I understand your question correctly you have implemented sign in with the iOS SDK, but you would like to enable sign in for your mobile web browser following these instructions:
https://developers.google.com/+/mobile/ios/sign-in
These are for a native iOS application. To implement sign in for mobile web you should follow the instructions for sign in on the web:
https://developers.google.com/+/web/signin/
Sorry if this doesn't answer your question directly, but if it doesn't please give more details about your problem.

Sign In with Google is now supported through the new Google Sign In iOS SDK. Migration instructions for users of the Google+ Sign In SDK are available here.

Related

What is the expected behaviour of Facebook login?

I want to know what the expected behaviour of Facebook login integrated in an iPhone app is, when a user is already logged into Facebook on the device through Facebook app, and the app is granted the required permissions in the previous login. I want to know if the app exits and starts again, should it still switch to Facebook app/website to check the permissions or should it silently log the user in without getting out of the app? Currently, my app switches to Facebook, detects that the user has already granted access, asks for an Ok or Cancel and comes back to the app. I wan to know if this behaviour is expected, because it seems it's doing nothing but unnecessary switching. I have asked this question in another form and I have included my code. Here's the link: http://bit.ly/1E1u2VI
Thank you!
It silently log the user in without getting out of the app. For that you can check the current user's permissions.
This might help you:
Controlling Login dialogs
The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. This is the default sequence that the Facebook SDK implements:
Facebook App Native Login Dialog
Facebook App Web Login Dialog
Mobile Safari Login Dialog
If the Facebook account is not set up, the Facebook SDK checks to see if the Facebook app is installed on the device. If the Facebook app is installed, the Facebook app native login dialog is presented if it's supported. If the Facebook app native login dialog can't be displayed because there's an old version of the app, the Facebook app web login dialog is presented. If the Facebook app isn't installed, mobile Safari is launched to display the Mobile Safari login dialog.
Here are the screenshots of code
I have checked the login process using safari browser it's work for me. [FBSDKAccessToken currentAccessToken] is working fine. I am attaching some screenshots might help you.

Create an manual twitter login and show profile ios app

I want to create an app to login into twitter, and then show user profile, I known how to show profile but I have to use account from setting. I want to create a login view, I found some information about xAuth and download a demo app, but it always have error 1012, another one is 401. Any other ways to login?
Please show me how to do this. Thank you!
I'm not totally sure about what you want to achieve.
If you want to login on Twitter from an iOS application without using the account defined in Settings, then you can use the STTwitter library.
The demo project for iOS shows how to login through Safari.
You can also use consumer xAuth-enabled tokens and login directly with Twitter credentials.

Share using Facebook Application

Right now I'm using a Facebook SDK to share posts from my application. The problem is that this sdk pops up a webview inside my app and asks the user to log in. There has to be a better way.
Can I send the share information to the facebook app on the users device (If they have it installed)? Or at least leverage the facebook app to check credentials? If people have to sign in to share, they probably won't do it..
The latest Facebook SDK 3.5 includes a native share dialog. If you follow the authentication workflow according do the documentation and the phone is on iOS 6.0 you should not get a UIWebView during authentication, instead you will get a UIAlertView.
Facebook login process would use WebView only in a few cases. Some of them are:
1) You are asking it to do so explicitly, by using - (void)openWithBehavior:(FBSessionLoginBehavior)behavior completionHandler:(FBSessionStateHandler)handler; which, I think, is not your case.
2) If there is no Facebook app installed on the device, FB SDK falls back to using WebView login window.
3) Probably, this is your case. If you are requesting publish permissions on the first attempt to open FB session, FB SDK will also fall back to old login flow envolving WebView. In the new login flow, FB session is supposed to be open with read permissions first (in that case, FB will use fast app switching or native iOS FB login):
+ (BOOL)openActiveSessionWithReadPermissions:(NSArray*)readPermissions allowLoginUI:(BOOL)allowLoginUI completionHandler:(FBSessionStateHandler)handler;
Then, you should ask additional publish permissions from the user:
- (void)requestNewPublishPermissions:(NSArray*)writePermissions defaultAudience:(FBSessionDefaultAudience)defaultAudience completionHandler:(FBSessionRequestPermissionResultHandler)handler;
That way, user will not need to log in (if he is logged in FB app already), but there will be inconvenience of double switching from your app to FB (though it works rather fast lately).
I was looking for a cleaner way to get publish permissions with FB Single Sign On on the first call, but unfortunately didn't find anything working yet.

How to avoid "App is allready authorized" with Facebook SDK 3.1

Every time i want to login through the Facebook idk, safari will be opened and tells me that my app is allready authorized. But i dont want to show this screen everytime a user logs in with Facebook. I followed the instructions over here to implement facebook login functionality. If the auth button is clicked i simple call the openSessionWithAllowLoginMethod which then handles the rest for me. But i dont how to apply the functionality, that it wont show the authorized screen everytime, to this code ? I would really appreciate some tips or hints.
Fill out every field related to your app in the Native iOS App section of the Basic Settings in the App Dashboard. If these fields are not configured, we can't drive traffic to your app or the iOS App Store. In addition, we use the iOS Bundle ID to streamline authentication for users who already authenticated your app. Pro-tip 3: Complete all iOS App Settings

Login to Facebook comments using embedded UIWebView through Facebook SSO

Is there any method to login facebook comments embbedded in UIWebView using SSO?
In my case ,I am developing website and native ios app.
so I should embbed page like below link in my native app.
http://techcrunch.com/2012/09/19/facebook-contact-sync/
this page is using facebook comments.
If I ask users one more login, this problem can be solved.
But I want to login through facebook SSO.(Don't want to ask one more user's id and password)
Facebook-ios-sdk with embedded UIWebView
this link showing me how to login my comments box in UIWebView using ios SDK...
is Answer at this link possible?
Get Access token using iOS facebook SDK,
and passing this token to java script at page to authentication user at comments box.
If it is possible, How to pass access token that acquired from ios SDK to java script SDK ?
or Does there exist another method?
I think easiest way to implement this is make session cookies for webview using access token.
but people saying this is impossible.
Loading iPhone webviews as an Facebook SSO authenticated user?
is it still impossible at new version of SDK?
Thanks in advance!

Resources