appleSSO method

Future<Map<String, dynamic>> appleSSO(
  1. String token,
  2. String backend,
  3. String clientId,
  4. List<String> scopes,
  5. Map body,
)

Implementation

Future<Map<String, dynamic>> appleSSO(String token, String backend,
    String clientId, List<String> scopes, Map body) async {
  try {
    final credential = await SignInWithApple.getAppleIDCredential(
      scopes: [
        AppleIDAuthorizationScopes.email,
        AppleIDAuthorizationScopes.fullName,
      ],
    );
    return {"token": credential.identityToken, "success": token};
  } catch (_) {}

  return {"token": "", "success": false};
}