How to get android phone user's google account name?

后端 未结 2 1010
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-25 04:00

So I am making mobile game with unity engine, think to release to android target.

Now my game will have my own custom highscore board, there I think when user earn score

2条回答
  •  长发绾君心
    2021-01-25 04:33

    If you have a string asdf@gmail.com and you want everything before the @ you can use .split();

    String email = asdf@gmail.com
    String[] parts = email.split("@");
    String nickname = parts[0];
    

提交回复
热议问题