public Task UpdateProfileAsync(string displayName = null, string photoUrl = null)
 {
     return(_wrapped
            .UpdateProfileAsync(new UserProfileChangeRequest.Builder()
                                .SetDisplayName(displayName)
                                .SetPhotoUri(Uri.Parse(photoUrl))
                                .Build()));
 }
Beispiel #2
0
        public async Task UpdateProfileAsync(UserProfileChangeRequest request)
        {
            try
            {
                var builder = new Firebase.Auth.UserProfileChangeRequest.Builder();

                if (request.IsDisplayNameChanged)
                {
                    builder.SetDisplayName(request.DisplayName);
                }
                if (request.IsPhotoUrlChanged)
                {
                    var uri = request.PhotoUrl != null?Android.Net.Uri.Parse(request.PhotoUrl.ToString()) : null;

                    builder.SetPhotoUri(uri);
                }

                await _user.UpdateProfileAsync(builder.Build()).ConfigureAwait(false);
            }
            catch (FirebaseException e)
            {
                throw ExceptionMapper.Map(e);
            }
        }