[native] Introduce code to call keyserver for registration in new flow
Summary:
This is the code that will actually register a user (ENG-4047). Some notes:
- I initially considered passing the avatar directly to the registration endpoint, but realized that gets complicated since we need a logged-in user in order to do a media upload. Instead here I first register the user, and in a later diff I'll handle setting the user's avatar.
- We don't yet have a screen for accepting terms (ENG-3951). For now I'm calling the registration endpoint from AvatarSelection, but after introducing a screen for accepting terms I'll move the registration call.
Depends on D8148
Test Plan:
The whole stack was tested as follows:
- Try creating an account with the default avatar
- Try creating an account with an emoji avatar
- Try creating an account with an image avatar (that needs to be uploaded)
- Try creating an Ethereum account with an ENS avatar
I made sure of the following:
- Loading spinner appeared on the button, not on the avatar, and was present throughout
- After the RegistrationNavigator is dismissed, the avatar that appears for the user's PRIVATE chat in the ChatThreadList is correct
- Subsequent delete-account-and-then-register-again worked correctly
- Various error cases are triggered correctly
Reviewers: atul, ginsu
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D8149