public static void ProcessUnauthorizedResponse(string errorJSONString) { if (SpilUnityEditorImplementation.unauthorized) { return; } SpilUnityEditorImplementation.unauthorized = true; JSONObject errorJSON = new JSONObject(errorJSONString); if (errorJSON.HasField("authError")) { long authError = errorJSON.GetField("authError").i; SpilErrorMessage error = new SpilErrorMessage(); switch (authError) { case 1: error.id = 32; error.name = "InvalidSpilTokenError"; error.message = "Spil Token is invalid! Please login again!"; break; case 2: error.id = 33; error.name = "RequriesLoginError"; error.message = "Event requires user login!"; break; default: error.id = 37; error.name = "SocialLoginServerError"; error.message = "Error communicating with the server!"; break; } SpilUnityImplementationBase.fireAuthenticationError(JsonUtility.ToJson(error)); } else { SpilErrorMessage error = new SpilErrorMessage(); error.id = 37; error.name = "SocialLoginServerError"; error.message = "Error communicating with the server!"; SpilUnityImplementationBase.fireAuthenticationError(JsonUtility.ToJson(error)); } }
/// <summary> /// This event indicates if an authentication error has occured on any event after the Social Login. /// </summary> public void AuthenticationError(string error) { SpilUnityImplementationBase.fireAuthenticationError(error); }