appleLoginRequest method

dynamic appleLoginRequest(
  1. String callback,
  2. String uuid,
  3. String type
)

Implementation

appleLoginRequest(String callback, String uuid, String type) async {
  if (canRun == true) {
    try {
      var credential = await SignInWithApple.getAppleIDCredential(
        scopes: [
          AppleIDAuthorizationScopes.email,
          AppleIDAuthorizationScopes.fullName,
        ],
      );
      String itoken = credential.authorizationCode;
      Map params = {
        "${getRandomString()}cd": itoken,
        "${getRandomString()}us": 1,
        "${getRandomString()}ud": uuid,
        "${getRandomString()}pe": type,
      };
      webviewController?.runJavaScript(
        "window.${getRandomCharacter()}('${callback}',${jsonEncode(params)})",
      );
    } catch (e) {}
  }
}