initialize method

  1. @override
Future<bool> initialize(
  1. double projectId, [
  2. String nonce = "borneo_security_default_nonce"
])
override

Initializes the Play Integrity API with the given projectId and optional nonce.

Returns true if initialization is successful, otherwise false.

Implementation

@override
Future<bool> initialize(double projectId,
    [String nonce = "borneo_security_default_nonce"]) async {
  return methodChannel.invokeMethod("initialize", {
    "project_id": projectId,
    "nonce": base64Encode(nonce.codeUnits)
  }).then((value) {
    _initialized = value ?? false;
    return _initialized;
  });
}