context method

AppContext context(
  1. String installId, {
  2. String? locale,
})

The bootstrap/auth app payload for installId, with every field cut to the gateway's limits so an unusual platform string never turns into a rejected bootstrap.

Implementation

AppContext context(String installId, {String? locale}) => AppContext(
  installId: installId,
  version: clampLength(version, 40),
  sdk: clampLength(sdk, 60),
  os: clampLength(os, 20),
  osVersion: clampLength(osVersion, 40),
  deviceModel: clampLength(deviceModel, 80),
  locale: shortLocaleTag(locale ?? deviceLocale),
);