Как мне войти в систему с Apple ID с помощью json и отозвать токен, когда пользователь хочет навсегда деактивировать учеIOS

Программируем под IOS
Anonymous
Как мне войти в систему с Apple ID с помощью json и отозвать токен, когда пользователь хочет навсегда деактивировать уче

Сообщение Anonymous »

На данный момент мне удалось это получить

Код: Выделить всё

String generateNonce([int length = 32]) {
final charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._';
final random = Math.Random.secure();
return List.generate(length, (_) => charset[random.nextInt(charset.length)])
.join();
}

String sha256ofString(String input) {
final bytes = utf8.encode(input);
final digest = sha256.convert(bytes);
return digest.toString();
}
И я использовал вход с Apple для входа в систему.

Код: Выделить всё

Future signInWithApple() async {
try {
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,
);

String authCodeString =
getAppleAuthorizationCode(appleCredential.authorizationCode);
log(authCodeString);

return await FirebaseAuth.instance.signInWithCredential(oauthCredential);
} on FirebaseAuthException catch (e) {
debugPrint(e.message);
debugPrint("CODE ${e.code}");
throw e;
}
}
В соответствии с недавним требованием Apple, нам необходимо предоставить возможность навсегда отозвать разрешения приложения и информацию для пользователя по запросу. Как нам это сделать? Пожалуйста, помогите мне понять это как можно больше. Спасибо ! :)

Подробнее здесь: https://stackoverflow.com/questions/733 ... r-wants-to

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