Send a Pass Link in an Airship Message

Include a mobile wallet pass link in an Airship message, either from the dashboard or API.

While you can include a pass link in the body of a message sent to any channel, you can configure messages you send to apps or web browsers to open the pass link based on a user interaction. This is also supported by our Push Templates.

  • Push Notifications and In-App Messages: When creating your message, choose the action that occurs when a user clicks or taps the message. Select either the Web Page action and paste the pass link, or the Adaptive Link action and select an adaptive link from the list.

  • In-App Automation: Choose what action occurs when a user taps a button in your message and associate the pass link with the button.

Apple Wallet passes have an additional option: when the user taps your notification, your app will open and prompt the user to view or add the pass.

  • Add the Airship In-App Wallet Action to your app.
  • When creating a push notification or in-app message in the dashboard, add the pass link in a Custom Key.
 Note

Because of the potential length of Google pass URLs, we advise using adaptive links or dynamic links instead of create pass calls. Dynamic links are ~120 characters maximum.

 Note

Configuration steps vary between composers and push templates, but the Content steps for push notifications and in-app messages have the same relevant options. Refer to the individual tutorials for full documentation.

  1. In the Content step of a composer or push template, enter your message text and select either:
    • Web Page action and paste your pass link.
    • Adaptive Link action and select from the dropdown menu.
       Note

      Only adaptive links created in the dashboard will appear in the dropdown list.

  2. Complete the remaining steps in the composer or push template setup.
  1. In the Actions step of the In-App Automation composer, select either:
    • Web Page action and paste your pass link.
    • Adaptive Link action and select an adaptive link from the dropdown menu.
       Note

      Only adaptive links created in the dashboard will appear in the dropdown list.

  2. Complete the remaining steps in the composer.
 Note

The Custom Key method is for Apple Wallet passes only.

First add the Airship In App Wallet Action to your app so it can handle a Wallet custom key. This allows users to save passes directly in the app without being redirected to Safari. Then register the action in the app registry.

Once your app is capable of handling a Wallet custom key, substitute the following Content and Delivery steps in each composer.

 Note

  • The configuration steps vary between composers and push templates, but the Content and Delivery steps have the same relevant options. The please refer to the individual tutorials for full documentation.

  • For push templates, Custom Keys is in the Content step and does not have a Delivery step.

  1. Follow the steps in these tutorials, selecting Push Notification as the message type, and pause at the Content step.
  2. In the Content step, enter the text that will display in your message, then select the Home action.
  3. Click Delivery in the progress header.
  4. Select a delivery type, then toggle on Custom Keys, and complete the configuration.
    1. Select iOS from the platform dropdown menu
    2. Enter the key and value:
      • key = wallet_action or ^w
      • value = the public pass URL or the adaptive link URL
  5. Complete the remaining steps in the composer.

API Examples

The examples below use this sample pass URL:

https://wallet-api.urbanairship.com/v1/download/pass/9cde359c-c6b6-c6b6-c6b6-1159b754c89c

See Actions in the Airship API reference.

{
   "audience":{
      "ios_channel": "b8f9b663-0a3b-cf45-587a-be880946e881"
   },
   "device_types":[ "ios" ],
   "notification":{
      "ios":{
         "alert":"20% off Kung Fu classes!"
      },
      "actions":{
         "open":{
            "type":"url",
            "content":"https://wallet-api.urbanairship.com/v1/download/pass/9cde359c-c6b6-c6b6-c6b6-1159b754c89c"
         }
      }
   }
}

Custom Key

Use the extra key in the iOS Override Object to specify the pass URL.

{
    "audience":{
        "ios_channel": "b8f9b663-0a3b-cf45-587a-be880946e881"
    },
    "device_types":[ "ios" ],
    "notification":{
        "ios":{
            "alert":"20% off Kung Fu classes!",
            "extra":{
               "^w" : "https://wallet-api.urbanairship.com/v1/download/pass/9cde359c-c6b6-c6b6-c6b6-1159b754c89c"
            }
        }
    }
 }