# `WalletPasses`
[🔗](https://gitlab.com/phinnaeus/wallet_passes/blob/main/lib/wallet_passes.ex#L1)

Apple Wallet and Google Wallet pass generation, management, and remote updates.

This module provides convenience functions that orchestrate both platforms.
For platform-specific control, use `WalletPasses.Apple.Builder`,
`WalletPasses.Google.Api`, etc. directly.

# `build_apple_pass`

Generates an Apple .pkpass binary for a pass.

Creates or retrieves the Apple pass record, then builds the .pkpass bundle.

# `google_save_url`

Generates a "Save to Google Wallet" URL for a pass.

Creates or retrieves the Google pass record, creates/updates the object
on Google's servers, and returns the save URL.

## Options

  * `:class_id` — Class ID suffix to use for the object (defaults to the
    pass type's standard suffix).
  * `:class_config` — Map of class configuration. When provided, ensures
    the class exists on Google's servers (idempotent — only created once
    per VM lifetime per class). The map's `:id` key defaults to the
    `:class_id` opt or to the pass type's standard suffix.
  * `:origins` — Passed through to `Google.SaveUrl`.

# `notify_apple_devices`

Sends Apple push notifications for a pass to trigger refresh on devices.

# `update_google_pass`

Updates a Google Wallet pass object on Google's servers.

## Options

  * `:class_id` — Pass-through to `Google.Api.update_object`.
  * `:class_config` — Map of class configuration. When provided, ensures
    the class exists on Google's servers (idempotent).

# `wallet_presence`

```elixir
@spec wallet_presence(String.t()) :: %{apple: boolean(), google: boolean() | nil}
```

Returns wallet presence for a pass across both platforms.

  * `:apple` — `true` when the pass has at least one device registration.
    Note: this is a "reachable for push" signal, not a "user has the pass"
    signal — see `WalletPasses.EventHandler.on_pass_removed/3` for the
    caveats around iOS push-token rotation and app uninstall.

  * `:google` — `true` when the latest recorded callback for the pass is
    `save`, `false` if `del`, and `nil` if no callback has been received
    (either the pass was never saved, or the consumer doesn't have
    `:google_callback_url` configured).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
