deviceActionFunction property

String get deviceActionFunction

The Firebase callable function name for device operations.

This is the unified callable that handles all device-related actions:

  • register: Register/update device with timezone, platform, app version
  • touch: Update lastActiveAt timestamp
  • updateToken: Update FCM token on the device document
  • unregister: Delete device document on logout
  • getMyDevices: Retrieve all devices for the current user

Can be set via:

  • Code: AppConfigBase.deviceActionFunctionDefault = 'myDeviceFunction'
  • Build flag: --dart-define DEVICE_ACTION_FUNCTION=myDeviceFunction

Default: 'deviceAction'

Implementation

static String get deviceActionFunction {
  _deviceActionFunction ??=
      const String.fromEnvironment('DEVICE_ACTION_FUNCTION', defaultValue: '').isNotEmpty
          ? const String.fromEnvironment('DEVICE_ACTION_FUNCTION', defaultValue: '')
          : (_deviceActionFunctionDefault ?? 'deviceAction');
  return _deviceActionFunction!;
}