identify method

Future<void> identify(
  1. String appUserId,
  2. String identityToken
)

Link the anonymous device identity to appUserId.

identityToken vouches for appUserId: your backend mints it with the secret key (POST /v1/identity-tokens) for the signed-in user and hands it to the app. It is valid for 15 minutes; fetch a fresh one for each identify.

The local write always succeeds and fires an onChange event; the server-side POST /v1/identify is best-effort — a failure (offline/5xx) is retried automatically later with the same token, not surfaced as an error here. Throws RovenueException on validation failure (a blank id or token), with RovenueErrorKind.identityTokenInvalid when the server refuses the token (expired, or minted for another user, project or environment: the bind is dropped, so identify again with a fresh token), and with RovenueErrorKind.subscriberUnresolvable when the server cannot resolve this install's subscriber (corrupt merge history) — the local link stands, unsynced, until the data is repaired.

Implementation

Future<void> identify(String appUserId, String identityToken) =>
    _platform.identify(appUserId, identityToken);