In the
Quality Checklist for Google Play Games Services, we're told to "Remember if players declined signing-in." In the readme, we're shown the code for authentication:
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
...
// authenticate user:
Social.localUser.Authenticate((bool success) => {
// handle success or failure
});
So how do I differentiate between the Authentication failing for some reason or the user declining to sign in? There's no error in the callback so I'm not sure whether I should assume failure (and ask the user next time they open the app) or assume rejection (and not ask again).
Social.localUser.Authenticate((bool success) => {
if(success)
{
// handle success
}
else
{
//handle failure
}
});
@TimberXiao I'm not asking how to differentiate between success and failure. I'm asking how to differentiate between failure because they denied to authenticate and failure because of other reasons (an actual error).
Intrestingly enough, Unity 2017 has another Authenticate function that takes a callback action that has an error string. I wonder if this is what is needed here; https://docs.unity3d.com/ScriptReference/SocialPlatforms.ILocalUser.Authenticate.html.
Interesting @JimmyDeemo! I'm curious if this string only gets set on error or if it also gets set when denied (or neither or just on denial...).
Ping
The error message is the same, whether I cancel (by pressing the back button) or if there is no internet connection.
In both cases it just says: "Authentication canceled"
Makes no sense
Bump. My experience is the same as dmitrykurteanu. I'm trying to account for the cert requirement "Remember if players declined signing-in" as well, and the only thing I have to go on with the Unity plugin is (bool success, string message) where message says "Authentication canceled" even in the event of an unrelated auth failure. So my only option seems to be look for the "Authentication canceled" regardless of why it happened and never automatically try it again. Which doesn't seem right.
Bump! I need a solution to this issue too!
It was requested by Google Play team in order to be featured on Play Store!
Please let us know whether authentication failed due to User Cancelled or Network Error