setAppCheckAutoRefresh function

void setAppCheckAutoRefresh(
  1. bool enabled, {
  2. String? app,
})

Whether the SDK refreshes a token on its own before it expires.

Off is the right default for a device that attests expensively — a TPM signature on a timer is not free — so this is the app's decision.

Implementation

void setAppCheckAutoRefresh(bool enabled, {String? app}) {
  final rc = _onApp(app, (a) => fdbAcSetAutoRefresh(a, enabled ? 1 : 0));
  if (rc != 0) {
    throw StateError(
      'setAppCheckAutoRefresh before initAppCheck${_on(app)} ($rc)',
    );
  }
}