Hello ! We are building a mobile game with Unity and Nakama, we need to upload custom profile avatars for each user, as I see in the documentation there is an “avatar_url” field but there is no way to upload the avatar picture using nakama, so I think we could handle this by our own.
We are working on Google Cloud so we decided to use Google Cloud Storage, but it has the drawback to allow users’ authentication only through Firebase, so we can’t upload pictures directly from the client.
We thought about 2 possible solutions:
- Serialize the avatar in base64 and pass it to a go runtime function through the payload of the rpc call, which will validate the user and eventually upload the image on Google Cloud Storage and update the user’s avatar url.
- Make a custom service that will receive the avatar through a post request with the nakama token, validate the user with his token calling the nakama service and then eventually upload the image on Google Cloud Storage and update the user’s avatar url.
What do you think ? Do you have some best practices for this ?