Gamend.Push.PushToken (gamend_core v1.0.1192)

Copy Markdown View Source

Ecto schema for a registered device push token.

Fields:

  • user_id – owner; a user has many devices
  • token – the FCM registration token or APNs device token (globally unique)
  • platform"android" | "ios" | "web"

  • provider"fcm" | "apns"; drives per-token delivery routing

  • device_id – optional stable device key so re-registering rotates the token in place instead of accumulating rows
  • disabled_at – set when the provider reports the token dead (soft-delete)
  • last_used_at – bumped on successful delivery
  • metadata – optional client info (app_version, locale, …), size-capped

Summary

Types

t()

A registered device push token.

Functions

The accepted platform values.

The accepted provider values.

Types

t()

@type t() :: %Gamend.Push.PushToken{
  __meta__: term(),
  device_id: String.t() | nil,
  disabled_at: DateTime.t() | nil,
  id: String.t() | nil,
  inserted_at: DateTime.t() | nil,
  last_used_at: DateTime.t() | nil,
  metadata: map(),
  platform: String.t() | nil,
  provider: String.t() | nil,
  token: String.t() | nil,
  updated_at: DateTime.t() | nil,
  user: term(),
  user_id: String.t() | nil
}

A registered device push token.

Functions

platforms()

@spec platforms() :: [String.t()]

The accepted platform values.

providers()

@spec providers() :: [String.t()]

The accepted provider values.