Handling google sign in alert buttons - ios

How do I handle google sign in buttons?
say I have this this button;
and after the person hits sign in,
it pops up this with confetti pod in the background running.
Though, if a user hits cancel, the confetti keeps running.
So, how do i handle the google buttons to make the confetti stop?
+ Take the user to another story board if they're fully signed in?

Related

GameCenter - check previous login before calling handler?

My app uses Game Center. I try to log the user when the VC loads.
If he was previously logged - great, it logs him in with the notification on top. If he wasnt logged in - great, it shows the Game Center login VC.
However, i want not to 'jump' on the user with the Game Center login VC when he enters the app. I want to have a button that brings up the Game Center login VC, which is easy to do, so only when he clicks the button, the Game Center login VC will come up.
The problem is - i discovered (through trial and error), that if i try to log the user in, and it fails (for example, the user was not logged in to Game Center at all), and if i dont bring the Game Center login VC at that moment - within the first call of the handler - i cant bring it up later on.
I'll explain - I implemented the button i talked about, which brings the GC login VC up. if i dont try to automatically log the user in on load, the button works as expected. But if i do, and it fails (for whatever reason), the button will not bring the VC up no matter what.
observations -
this shows that this is indeed Apple policy.
trying to bring the GC login VC up after failed handler login doesnt work at all, not related at all to VC appearance.
I found this question here on stackoverflow, but could not find my answer there.
My questions to you are:
Is that intended that you can only call the handler once per app run (Even though VC was not shown at first handler call)?
Is it possible to do what i asked? if so - how? I would love to able to try to login without showing VC only if i know it will succeed, so i can 'save' the handler call for the button that shows the GC login VC. I know that the information is available in the handler (according to this), im wondering if there is another way.
To conclude my questions - Do i have to 'jump' the user with the
login VC the moment i try to log him in? (if there is a GC logged in
user on the device, a VC is not required)
I hope this was clear, since its a confusing situation.
Sorry for the long post!
Thanks alot for your time!
You keep some NSUserDefaults like 'userHasAttemptedToUseGameCenter'. It starts as NO or undefined, which to you means NO. Then when they press the game center button you set to YES and try to do the game center authentication. From then on every time they open the game (or at least every time they go to a game center related screen / feature, then you do game center authentication.
Even when its working fine because you have a game center user it can be a pain because the 'Welcome back' game center banner will pop down and cover the top part of your games UI for the first few moments.
If you just let the game center authentication come up every time but the user doesn't want it, I think after 3 failed attempts to authenticate iOS will NEVER show the authentication again. Your user will then be totally stuck if they change their mind later and want to use a feature that needs game center. You can detect that case only because game center won't authenticate! And all you can do then is tell the user to go to the Game Center app and log in there. Its hell to test. If one of your test devices gets into this locked out state you have to do a 'Reset all content and settings'.
Please someone chime in if this has gotten any better in iOS8.

Facebook login in an iOS app

I am wondering how things should work when using facebook login in an iOS app.
I have set up a trial app in order to understand the facebook login process within an iOS app.
I have a “Login with Facebook” button. When I tap it for the first time, it goes asking for permissions, then I tap YES and it comes back to my app.
At this point all is fine, I have a “Log out” button. I tap it, I get logged out as expected and can see the “Login with Facebook” button again.
Now here comes the question. When I tap the “Login with Facebook” button for the 2nd (or Nth) time, it shows me the facebook Confirm page displaying:
“You have already authorized THIS APP”
with a Cancel and an OK button.
Is this the way it should be?
It seems to me that the user knows he has already authorized THIS APP and does not need to be prompted each time.
In other words after tapping the “Login with Facebook” button it should not go through the facebook Confirm page.
Am I wrong?
If NO, why is this happening in my app?

Any way to re-show Game Center login view? (Xcode)

My app attempts to log the player in when it finishes loading, like good little apps should (so says Apple). But if the player chooses to cancel the initial log-in, I wanted the app to re-attempt to authenticate the player if the player taps the leaderboard button in the game. (otherwise, of course, the button couldn't do anything if the player is not authenticated)
Unfortunately, after some research I discovered that Apple does not seem to allow an app try again to re-authenticate the player after the player cancels the first time, until the player exits and re-enters the game. (If the player cancels three or so times, Apple goes aggro and disables Game Center from the app on that device entirely. Even logging into Game Center from the stand alone app won't help after that point.)
Is there any way around this so that my app can attempt the authentication both when the app loads, and any time the player taps leaderboard button while not logged in? Or do I just have to have my leaderboard button display a message when not authenticated saying that Apple's being dumb and overprotective and not letting my app respond the way it should? (Perhaps not quite in those words...)
I've used an alternative approach that might solve your requirement. When they tap on the leaderboard, check the Game Center connection state.
If it is not GCPConnectionStateEnabledFully then throw up an alert like this "Error connecting to Game Center. Please make sure you are signed into Game Center and check your internet connection". Then inevitably they will leave your app to check and when they return the Login prompt will appear a few seconds after they return to the app.
Testing note: When you are testing these scenarios you might cancel the login prompt 3 times. If you do that it will stop prompting you altogether and you need to reset all settings in the Settings app. I remember this being really frustrating.

How to show game center authenticate login alert multi times?

I'm building a game and I want to make game center something like the app High Moon. Which is when authenticating, when Apple's game center login alert shows, if the user tap cancel, I will show an alert, when my alert dismisses, I want to show Apple's game center login again. This means if the user doesn't login to game center, he can't play the game.
The problem is that,when I call authenticate method to show the login alert again, Apple's game center login alert doesn't show. Someone know how to show it again? Thanks.
Actually you can't.
And the interesting part in this, if the user presses cancel three times in a row, the dialog won't appear again. Ever. Even if you have the authentication code called, the user has to go to the game center app, login, then come back.
Source: GameKit Docs.

ipad forcing login screen

I've seen a couple of threads regarding the use of login screens but just doesn't require what I need. When my application first launches the login screen is present, they enter in the username/password and is verified on the server. If successful they can go to other sections of the application. As this application contains confidential documents, every time the application goes to sleep or the home button is pressed and upon re-entry I show a UIAlertView to confirm their password.
What I would prefer is that when the application goes to sleep the UIAlertView is shown so I'll leave it as is but when the home button is pressed, I want to force them to go back to the original login screen. I've been playing with the exit(0) but apple strongly advise against that but it forces the application to exit and then when the application opens again the login screen is displayed. I'm try to replicate this functionality without the exit(0).
Terminating your app is probably not the right approach. Consider: How do I programmatically quit my iPhone application?.
There is no API provided for gracefully terminating an iPhone
application. Under the iPhone OS, the
user presses the Home button to close
applications. Should your application
have conditions in which it cannot
provide its intended function, the
recommended approach is to display an
alert for the user that indicates the
nature of the problem and possible
actions the user could take - turning
on WiFi, enabling Location Services,
etc. Allow the user to terminate the
application at their own discretion.
You should reconsider your first approach with the UIAlertView if the use of login screens doesn't meet your needs.

Resources