useDebugAppCheckProvider function

void useDebugAppCheckProvider({
  1. String debugToken = '',
})

Installs the SDK's debug provider.

For development: the token has to be registered in the Firebase console, and it attests to nothing. An empty debugToken leaves the SDK reading APP_CHECK_DEBUG_TOKEN from the environment itself.

Implementation

void useDebugAppCheckProvider({String debugToken = ''}) {
  if (!hasFirebase) throw StateError('this build has no Firebase SDK');
  final t = debugToken.toNativeUtf8();
  try {
    final rc = fdbAcUseDebugProvider(t.cast());
    if (rc != 0) {
      throw StateError('the debug provider could not be installed ($rc)');
    }
  } finally {
    calloc.free(t);
  }
}