我目前对如何继续使用我的应用程序感到茫然。 我目前正在按照教程进行身份验证,并且一切都很顺利。 Azure Mobile Apps AuthenticationAzure移动应用程序 - Android身份验证获取更多信息
我无所适从的是如何使用在此过程之后存储的id和/或令牌来获取基本配置文件信息,例如用户电子邮件或其个人资料照片。 从我在网上阅读这只是一个azureId存储不是谷歌配置文件ID,我会用谷歌+ APIS。
有没有人有一个参考,显示新手程序员如何获得使用谷歌API所需的电子邮件地址或userId。 我能找到的唯一参考资料是2014年的博客文章。当然必须有一个更简单的方法。还有一个专门针对移动应用而不是移动服务的文章。 Blog post describing how to expand on authentication with google on mobile services which is no use
这里是我的过程
// We first try to load a token cache if one exists.
Log.v(TAG, "Click"+USERIDPREF);
if (loadUserTokenCache(mClient))
{
Log.v(TAG, "table" +mClient.getCurrentUser().toString());
createTable();
returnHome();
}
// If we failed to load a token cache, login and create a token cache
else
{
// Login using the Google provider.
final ListenableFuture<MobileServiceUser> mLogin = mClient.login(MobileServiceAuthenticationProvider.Google);
Futures.addCallback(mLogin, new FutureCallback<MobileServiceUser>() {
@Override
public void onFailure(Throwable exc) {
Log.v(TAG, "Login On fail " +exc.getMessage());
}
@Override
public void onSuccess(MobileServiceUser user) {
Log.v(TAG, "On Success");
createTable();
cacheUserToken(mClient.getCurrentUser());
Log.v(TAG, "On Success" + mClient.getCurrentUser());
returnHome();
}
});
}
从2014年引用的帖子很旧,应该忽略。它正在讨论已弃用的移动服务,而现在您正在使用移动应用程序。 –
我改变了我刚刚收录的标题,所以人们不会认为我的解决方案只是Google搜索。 –