[英]Can I get the email address from a user sign-in with the Twitter framework in iOS 5+?
[英]What if application delete and then reinstalled how i can get the email address and name Sign in With Apple
最近我的應用程序被蘋果拒絕,問題必須包括用蘋果登錄,然后我嘗試過,現在我遇到了一個用例,到目前為止找不到解決方案。
如果用戶在我的應用程序中使用蘋果登錄並獲取電子郵件地址以在我的服務器上注冊,但是如果他刪除應用程序然后在一段時間后重新安裝應用程序會發生什么,他將無法按照蘋果文檔獲取電子郵件地址
if ([authorization.credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
// ASAuthorizationAppleIDCredential
ASAuthorizationAppleIDCredential *appleIDCredential = authorization.credential;
NSString *user = appleIDCredential.user;
[[NSUserDefaults standardUserDefaults] setValue:user forKey:setCurrentIdentifier];
[mStr appendString:user?:@""];
NSString *familyName = appleIDCredential.fullName.familyName;
[mStr appendString:familyName?:@""];
NSString *givenName = appleIDCredential.fullName.givenName;
[mStr appendString:givenName?:@""];
NSString *email = appleIDCredential.email;
[mStr appendString:email?:@""];
NSLog(@"mStr:%@", mStr);
[mStr appendString:@"\n"];
appleIDLoginInfoTextView.text = mStr;
}
一旦我成功注冊並獲得電子郵件地址,即使我刪除了應用程序,我也不會第二次收到電子郵件。
除了第一次之外,您並不總是收到電子郵件。 但每次登錄時,您都會獲得一個唯一標識符,可用於檢索電子郵件和其他詳細信息。
將這些詳細信息保存在服務器上托管的數據庫中,或者從鑰匙串中保存/檢索它們。 保存在鑰匙串中的項目不會在應用卸載時刪除。 因此,您可以輕松地從 Keychain 中檢索這些詳細信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.