public static Firebase.Auth.ActionCodeSettings ToNative(this ActionCodeSettings self)
        {
            if (self == null)
            {
                return(null);
            }

            var actionCodeSettings = new Firebase.Auth.ActionCodeSettings();

            if (self.IsUrlChanged)
            {
                actionCodeSettings.Url = self.Url != null ? new NSUrl(self.Url) : null;
            }
            if (self.IsIosBundleIdChanged)
            {
                actionCodeSettings.IOSBundleId = self.IosBundleId;
            }
            if (self.IsAndroidPackageChanged)
            {
                actionCodeSettings.SetAndroidPackageName(self.AndroidPackageName,
                                                         self.AndroidInstallIfNotAvailable,
                                                         self.AndroidMinimumVersion);
            }
            if (self.IsHandleCodeInAppChanged)
            {
                actionCodeSettings.HandleCodeInApp = self.HandleCodeInApp;
            }

            return(actionCodeSettings);
        }
        public static Firebase.Auth.ActionCodeSettings?ToNative(this ActionCodeSettings self)
        {
            if (self == null)
            {
                return(null);
            }

            var builder = Firebase.Auth.ActionCodeSettings.NewBuilder();

            if (self.IsUrlChanged)
            {
                builder.SetUrl(self.Url);
            }
            if (self.IsIosBundleIdChanged)
            {
                builder.SetIOSBundleId(self.IosBundleId);
            }
            if (self.IsAndroidPackageChanged)
            {
                builder.SetAndroidPackageName(self.AndroidPackageName,
                                              self.AndroidInstallIfNotAvailable,
                                              self.AndroidMinimumVersion);
            }
            if (self.IsHandleCodeInAppChanged)
            {
                builder.SetHandleCodeInApp(self.HandleCodeInApp);
            }

            return(builder.Build());
        }
Ejemplo n.º 3
0
 public async Task VerifyBeforeUpdateEmail(string newEmail, ActionCodeSettings actionCodeSettings)
 {
     try
     {
         await _user.SendEmailVerificationBeforeUpdatingEmailAsync(newEmail, actionCodeSettings.ToNative()).ConfigureAwait(false);
     }
     catch (NSErrorException e)
     {
         throw ExceptionMapper.Map(e);
     }
 }
Ejemplo n.º 4
0
 public async Task SendEmailVerificationAsync(ActionCodeSettings actionCodeSettings)
 {
     try
     {
         await _user.SendEmailVerificationAsync(actionCodeSettings.ToNative()).ConfigureAwait(false);
     }
     catch (NSErrorException e)
     {
         throw ExceptionMapper.Map(e);
     }
 }
Ejemplo n.º 5
0
 public async Task VerifyBeforeUpdateEmail(string newEmail, ActionCodeSettings actionCodeSettings)
 {
     try
     {
         await _user.VerifyBeforeUpdateEmail(newEmail, actionCodeSettings.ToNative()).AsAsync().ConfigureAwait(false);
     }
     catch (FirebaseException e)
     {
         throw ExceptionMapper.Map(e);
     }
 }