Подписать от Apple, используя FlutterIOS

Программируем под IOS
Ответить
Anonymous
 Подписать от Apple, используя Flutter

Сообщение Anonymous »

Как я могу выходить из Apple, используя Flutter
Я использую sign_in_with_apple < /strong> плагин +, когда я обозначаю Apple и пытаюсь распечатать электронную почту, я получаю null < /p>
Future signInWithApple() async {
// To prevent replay attacks with the credential returned from Apple, we
// include a nonce in the credential request. When signing in with
// Firebase, the nonce in the id token returned by Apple, is expected to
// match the sha256 hash of `rawNonce`.
SharedPreferences prefs=await SharedPreferences.getInstance();
final rawNonce = generateNonce();
final nonce = sha256ofString(rawNonce);

// Request credential for the currently signed in Apple account.
final appleCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
nonce: nonce,
);

// Create an `OAuthCredential` from the credential returned by Apple.
final oauthCredential = OAuthProvider("apple.com").credential(
idToken: appleCredential.identityToken,
rawNonce: rawNonce,
);

prefs.setString("email", appleCredential.email.toString());
print("hello $appleCredential");
prefs.setString("mode", "apple");

// Sign in the user with Firebase. If the nonce we generated earlier does
// not match the nonce in `appleCredential.identityToken`, sign in will fail.
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context)=>HomePage()), (route) => false);
return await FirebaseAuth.instance.signInWithCredential(oauthCredential);
}


Подробнее здесь: https://stackoverflow.com/questions/692 ... ng-flutter
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»