Skip to content

Instantly share code, notes, and snippets.

@quellish
Created October 3, 2018 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quellish/3168d51c714c2bbd8e314997b111ec74 to your computer and use it in GitHub Desktop.
Save quellish/3168d51c714c2bbd8e314997b111ec74 to your computer and use it in GitHub Desktop.
Mixing content-available and alert
{
    "aps": {
        "alert": {
            "body": "Test message",
            "title": "Optional title",
            "subtitle": "Optional subtitle"
        },
        "content-available": 1
    }
}

Silent notifications tell an application to load new content and update the user interface in the background. Alerts, badges, and sounds however are not delivered in the background and are visible to the user. A notification can be visible to a user or it can be silent. It can not be both. This notification contains both an alert and the content-available key that marks this as a silent notification. iOS will not be able to reason about how this notification should be delivered and may fail to deliver it completely.

You can validate your push notification payloads to find problems like this one using the push validation tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment