Quickstart-unity: Firebase corrupts UserProfile.PhotoUrl on iOS

Created on 2 Apr 2019  路  3Comments  路  Source: firebase/quickstart-unity

Unity editor version: 2018.3.9f1
Firebase Unity SDK version: 5.6.0
Additional SDKs you are using (Facebook, AdMob, etc.): No
Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): iOS

The following problem happens on iOS device, in Mac Editor there is no such problem.

I am trying to change user profile picture.

  1. I upload picture to FirebaseStorage and receive a valid download Uri like this: https://firebasestorage.googleapis.com/v0/b/payback-app-ad5e5.appspot.com/o/XUURz6wN5BVmtKJCH3KmIPCCm7C3%2Fprofile_picture.jpg?alt=media&token=0bb2585b-446e-40d8-8708-f69cba23dffa
  2. Then I wish to update user's UserProfile with Uri to the new picture:
var profile = new UserProfile();
profile.PhotoUrl = downloadUri; // downloadUri is valid 
user.UpdateUserProfileAsync(profile);
  1. Next time I'm accessing FirebaseAuth.DefaultInstance.CurrentUser.PhotoUrl I am getting corrupted (escaped?) Uri:
    https://firebasestorage.googleapis.com/v0/b/payback-app-ad5e5.appspot.com/o/XUURz6wN5BVmtKJCH3KmIPCCm7C3%252Fprofile_picture.jpg?alt=media&token=0bb2585b-446e-40d8-8708-f69cba23dffa

  2. Which leads me to 404 error page

Problem: after going through UserProfile update process Uri now includes extra characters (52 in the above case).

Current workaround for me is to store user's photoUrl separately in Realtime Database.

bug

All 3 comments

@GeorgeFedoseev

Thank you for reporting this issue.
I think the problem is that profile.PhotoUrl setter converts the uri incorrectly.
So at the meantime, RT DB would be your best bet.

I'll keep you posted when the fix is released.
Shawn

This bug should be fixed in the 5.7.0 version of the Firebase Unity SDK.

Let us know if you're still experiencing the issue!

--Patrick

Great, I'll check!

Was this page helpful?
0 / 5 - 0 ratings