Test your push implementation

Updated

After you set up push notifications, you should send some test messages. You can send messages through the Customer.io push composer. If your app is set up to send more than the standard title, body, image, and link, you’ll need to send a custom payload.

The custom payload editor for a push notification
The custom payload editor for a push notification

The payloads below represent what your app can expect to receive from Customer.io. If you use a custom payload, you’ll need to use the format(s) below to make sure that the SDK receives your message properly.

When testing, you should:

  • Set the link to the deep link URL that you want to open when your tester taps your notification.
  • Set the image to the URL of an image you want to show in your notification. It’s important that the image URL starts with https:// and not http:// or the image might not show up.
    {
        "aps": {
            // basic iOS message and options go here
            "mutable-content": 1,
            "sound": "default",
            "alert": {
                "title": "string", //(optional) The title of the notification.
                "body": "string" //(optional) The message you want to send.
            }
        },
        "CIO": {
            "push": {
                "link": "string", //generally a deep link, i.e. my-app:://...
                "image": "string" //HTTPS URL of your image, including file extension
            }
        }
    }
    
        • image string
          The URL of an HTTPS image that you want to use for your message.
        • link string
          A deep link (to a page in your app), or a link to a web page.
      • alert
        string
        A simple alert message.
      • badge integer
        The number you want to display on your app’s icon. Set to 0 to remove the current badge, if any.
      • category string
        The notification’s type. This string must correspond to the identifier of one of the UNNotificationCategory objects you register at launch time.
      • content-available integer
        The background notification flag. Use 1 without an alert to perform a silent update. 0 indicates a normal push notification.
      • interruption-level string
        Indicates the importance and delivery timing of a notification.

        Accepted values:passive,active,time-sensitive,critical

      • mutable-content integer
        If you use the Customer.io SDK, you must set this value to 1 to support images and “delivered” metrics from your push notifications. When the value is 1, your notification is passed to your notification service app extension before delivery. Use your extension to modify the notification’s content.
      • relevance-score number
        A number between 0 and 1. The highest score is considered the “most relevant” and is featured in the notification summary.
      • sound
        string
        The name of a sound file in your app’s main bundle or in the Library/Sounds folder of your app’s container directory. Use “default” to play the system sound. For critical alerts, you’ll pass an object instead.
      • target-content-id string
        The identifier of the window brought forward.
      • thread-id string
        An identifier to group related notifications.
    {
      "message": {
        "apns": {
          "payload": {
            "aps": {
              // basic iOS message and options go here
              "mutable-content": 1,
              "sound": "default",
              "alert": {
                "title": "string", //(optional) The title of the notification.
                "body": "string" //(optional) The message you want to send.
               }
            },
            "CIO": {
              "push": {
                "link": "string", //generally a deep link, i.e. my-app://... or https://yourwebsite.com/...
                "image": "string" //HTTPS URL of your image, including file extension
              }
            }
          },
          "headers": {
            // (optional) headers to send to the Apple Push Notification Service.
            "apns-priority": 10
          }
        } 
      }
    }
    
              • body string
                The body of your push notification.
              • image string
                The URL of an HTTPS image that you want to use for your message.
              • link string
                A deep link (to a page in your app), or a link to a web page.
              • title string
                The title of your push notification.
            • alert
              string
              A simple alert message.
            • badge integer
              The number you want to display on your app’s icon. Set to 0 to remove the current badge, if any.
            • category string
              The notification’s type. This string must correspond to the identifier of one of the UNNotificationCategory objects you register at launch time.
            • content-available integer
              The background notification flag. Use 1 without an alert to perform a silent update. 0 indicates a normal push notification.
            • interruption-level string
              Indicates the importance and delivery timing of a notification.

              Accepted values:passive,active,time-sensitive,critical

            • mutable-content integer
              If you use the Customer.io SDK, you must set this value to 1 to support images and “delivered” metrics from your push notifications. When the value is 1, your notification is passed to your notification service app extension before delivery. Use your extension to modify the notification’s content.
            • relevance-score number
              A number between 0 and 1. The highest score is considered the “most relevant” and is featured in the notification summary.
            • sound
              string
              The name of a sound file in your app’s main bundle or in the Library/Sounds folder of your app’s container directory. Use “default” to play the system sound. For critical alerts, you’ll pass an object instead.
            • target-content-id string
              The identifier of the window brought forward.
            • thread-id string
              An identifier to group related notifications.
          • Custom key-value pairs* any type
            Additional properties that you've set up your app to interpret outside of the Customer.io SDK.
Copied to clipboard!
  Contents
Current release
 3.4.1
Is this page helpful?