public FacebookAuth(ICloudAuthConfig config) { var onFBInitedHandler = default(InitDelegate); onFBInitedHandler = () => { if (!FB.IsInitialized) { "Failed to Initialize the Facebook SDK".LogError(); _inited = false; } else { FB.ActivateApp(); _inited = true; } }; //Init Facebook SDK if (!FB.IsInitialized) { FB.Init(onFBInitedHandler); } else { _inited = true; } }
public GooglePlayServiceAuth(ICloudAuthConfig config) { var cfg = new PlayGamesClientConfiguration.Builder() .RequestServerAuthCode(false) .RequestEmail() .RequestIdToken() .Build(); PlayGamesPlatform.InitializeInstance(cfg); PlayGamesPlatform.Activate(); }
public GoogleAuth(ICloudAuthConfig config) { var webClientID = config.GetConfig <string>(GoogleAuthConfig.WEB_CLIENT_ID); Google.GoogleSignIn.Configuration = new Google.GoogleSignInConfiguration() { RequestIdToken = true, WebClientId = webClientID }; _inited = true; }
public static ICloudAuth Create(ICloudAuthConfig config) { if (config.IsNull()) { return(null); } var service = config.GetConfig <CloudAuthType>(nameof(CloudService)); if (auths.ContainsKey(service)) { return(auths[service]); } switch (service) { #if GOOGLE_AUTH case CloudAuthType.GoogleSignIn: { return(auths[service] = new GoogleSignIn.GoogleAuth(config)); } #endif #if FACEBOOK_AUTH case CloudAuthType.Facebook: { return(auths[service] = new Facebook.FacebookAuth(config)); } #endif #if FIREBASE_AUTH case CloudAuthType.Firebase: { return(auths[service] = new Firebase.FirebaseCloudAuth(config)); } #endif #if PLAYSERVICE_AUTH case CloudAuthType.GooglePlayService: { return(auths[service] = new GooglePlayService.GooglePlayServiceAuth(config)); } #endif default: { "Service Unavailable".LogError(); return(null); } } }
public FirebaseCloudAuth(ICloudAuthConfig config) { Init(); }