Search code examples
huawei-developershuawei-mobile-servicesappgallery-connect

What is the best practice to manage user profile when using Huawei Auth Service


When using Huawei AppGallery Connect Auth Service, I tried to get user profiles by using getPhone(), getEmail(), getDisplayName(), etc according to the reference from Huawei Developer Site. But for the most time, if not all the time, getEmail() returns a null. So does getPhone().

How do I suppose to manage the user profile if such info is always empty?


Solution

  • Your best practice would be to capture such info and mange it locally regardless what is available from AGConnectAuth.getInstance().getCurrentUser(). getPhone() would return a value when using Auth service by registering with phone number. getEmail would return a value when registering with email account. This is not ideal, but this is what has been designed.