Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用登录
Syncano.getInstance().loginSocialUser()
如何检查用户是否已登录?最好没有该参数的异步值。
通话后,您会收到回复。如果 isSuccess() 返回 true,则表示您已登录。您还会在 Response 中获得一个用户对象。此类请求成功后应设置用户密钥,因此您可以使用此代码进行检查。
return !(getUser() == null || getUser().getUserKey() == null || getUser().getUserKey().isEmpty());
编辑
在最新版本的库中有一个新方法:
syncano.isUserLoggedIn()