0
我已經成功地集成谷歌的API來登錄使用G +帳戶,谷歌加登錄
我能夠得到用戶的電子郵件地址和姓名,我所需要的所有信息,
但我期待的方式,我如何將這些信息發送給我的開發人員電子郵件ID,以便我可以通過gmail與用戶溝通。
這裏是我使用來獲取所有的代碼,
private void getProfileInformation() {
try {
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person currentPerson = Plus.PeopleApi
.getCurrentPerson(mGoogleApiClient);
String personName = currentPerson.getDisplayName();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
sharedPreferences=this.getPreferences(1);
edt = sharedPreferences.edit();
edt.putString("personName", personName);
edt.putString("personPhotoUrl", personPhotoUrl);
edt.putString("personGooglePlusProfile", personGooglePlusProfile);
edt.putString("email",email);
edt.apply();
Log.e(TAG, "Name: " + personName + ", plusProfile: "
+ personGooglePlusProfile + ", email: " + email
+ ", Image: " + personPhotoUrl);
// by default the profile url gives 50x50 px image only
// we can replace the value with whatever dimension we want by
// replacing sz=X
personPhotoUrl = personPhotoUrl.substring(0,
personPhotoUrl.length() - 2)
+ PROFILE_PIC_SIZE;
new LoadProfileImage(imgProfilePic).execute(personPhotoUrl);
} else {
Toast.makeText(getApplicationContext(),
"Person information is null", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
} }
你想發送用戶的電子郵件ID到您的電子郵件地址? –
是的,我想要.. –