- Home /
Detect Game Center login prompt?
There is another thread that brought this question up but no one answered it.
The question I have is: is it remotely possible to detect if the game center login comes up? That login shows up whenever, which is a problem if the player begins a level and they are asked to log into GC. The pause/focus functions of Unity do not seem to engage when that happens.
If not, then it's a really a shame that they never bothered to include that feature into Unity. I'd rather not buy an extra package (like Prime31, if that applies) only to fix this simple problem, since that would cost additional money and time (to incorporate that package into the project).
Answer by unimechanic · Jul 04, 2014 at 07:14 PM
Unfortunately it doesn't seem possible to detect when GameCenter authentication screen appears, you would need to manually pause the game between the moment at which the authentication is requested and the response events.
From my research it seems that there was a way to detect GC, that is using this event:
The Unity iOS player is already listening to it and should trigger the pause events. But it isn't called currently. Maybe that was changed by Apple as a security measure, but I'm assuming.
I actually asked Unity support and it appears that you cannot know when the request comes up.
Pausing the game between the request and response events would not be the best solution because the user can always un-pause the game and then have the GC login prompt come up after that. The best you can do is do a login request when the player isn't doing something that could cause them to miss an important game event.