WalletPasses (wallet_passes v0.6.0)

Copy Markdown View Source

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.

Summary

Functions

Generates an Apple .pkpass binary for a pass.

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

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

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

Returns wallet presence for a pass across both platforms.

Functions

build_apple_pass(pass_data, visual)

Generates an Apple .pkpass binary for a pass.

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

google_save_url(pass_data, visual, opts \\ [])

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(serial_number)

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

update_google_pass(pass_data, visual, opts \\ [])

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(serial_number)

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

Returns wallet presence for a pass across both platforms.

  • :appletrue 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.

  • :googletrue 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).