IOS

Push.Delivery offers the possibility to send push notifications to iOS devices over Apple APNS.

App-Integration

Therefore it is necessary to integrate the subscription API with your specific iOS App. The subscription API gives full flexibility for developers to handle the end user tag/topic subscriptions.

Authentication methods

Currently we are offering our clients two methods for authentication:

  • Certificate Based

  • Token Based

Certificate Based

For certificate based push, it is necessary to use a certificate to establish a secure connection. This certificate can be obtained from Apple through a developer account and has to be provided by the App developer. More information about that can be found here.

Certificate based pushes has a disadvantage that certificate is valid for only a year and you must update them to continue communicating with APNs.

Token Based

Token based push is another way of establishing a secure connection to APNs. Therefore, a token is required, which can be generated through an app developer account and put into Push.Delivery. More information about that can be found here.

Setup iOS in Admin UI

Please go into the "Apps" tab and add a new App.

Give your App a name, e.g. "My iOS App".

Then select the platform "iOS".

Upload an icon for the channel. This is only used inside the Push Admin so that you easier can recognize the channels by image.

Also it is required to use a Push template. This template is used to define the information that will be sent with the iOS Push.

You can use this default template and modify it to your individual needs:

Also you have the possibility to choose between the two authentication methods:

  • Certificate based

  • Token based

If you go for certificate based pushes you can upload your certificate together with the Keystore password and "save".

If you use token based pushes you can upload your token and enter the other requested information:

  • Key ID

  • Team ID

  • Apple App Bundle ID

If fields related to both certificate and token based authentications are entered in push console at same time, then by design system prefers token based authentication.
Select the "sandbox" checkbox, if you want to send push against development server of APNS. Otherwise by default it is production server.

After successfully creating the App for iOS the following information will be automatically shown inside the App:

  • ApiUser: This is the API username.

  • Password: This is the password for the API user.

  • AccessToken: Instead of using username and password an Acess Token is created.

  • platformId: The platform ID.

  • AppId: The App ID.

add ios app

After setting up the App, it is time to create Tags that users can register for.

Customize Payload

You can use this default template and modify it to your individual needs.

Default template:

[
  {
    "operation": "shift",
    "spec": {
      "title": "alertObj.title",
      "message": "alertObj.body",
      "url": "customFields.web-site-url"
    }
  },
  {
    "operation": "default",
    "spec": {
      "badge": 0,
      "sound": "default",
      "rich": true
    }
  }
]

Default payload before transformation:

{
  "title": "Default Title",
  "message": "This is the default message",
  "url": "/web-service/sample-link"
}

Default payload after transformation:

{
  "alertObj" : {
    "title" : "Default Title",
    "body" : "This is the default message"
  },
  "customFields" : {
    "web-site-url" : "/web-service/sample-link"
  },
  "rich" : true,
  "sound" : "default",
  "badge" : 0
}
To learn more about how to create and modify JOLT templates please follow up in our developer documentation: push-templates

Payload Object

Parameter

Type

Description

Required

Defaults

Comments

Usage

alertObj.title

String

the aps dictionary → alert dictionary → title

Required

-

APNS setting

The title of the notification.

alertObj.body

String

the aps dictionary → alert dictionary → body

Required

-

APNS setting

The content of the alert message.

alertObj.launch-image

String

the aps dictionary → alert dictionary → launch-image

Optional

-

APNS setting

The name of the launch image file to display.

alertObj.title-loc-key

String

the aps dictionary → alert dictionary → title-loc-key

Optional

-

APNS setting

The key for a localized title string.

alertObj.title-loc-args

Array of strings

the aps dictionary → alert dictionary →title-loc-args

Optional

-

APNS setting

An array of strings containing replacement values for variables in your title string. Each %@ character in the string specified by the title-loc-key is replaced by a value from this array. The first item in the array replaces the first instance of the %@ character in the string, the second item replaces the second instance, and so on.

alertObj.subtitle-loc-key

String

the aps dictionary → alert dictionary → subtitle-loc-key

Optional

-

APNS setting

The key for a localized subtitle string.

alertObj.subtitle-loc-args

Array of strings

the aps dictionary → alert dictionary → subtitle-loc-args

Optional

-

APNS setting

An array of strings containing replacement values for variables in your subtitle string. Each %@ character in the string specified by subtitle-loc-key is replaced by a value from this array. The first item in the array replaces the first instance of the %@ character in the string, the second item replaces the second instance, and so on.

alertObj.loc-key

String

the aps dictionary → alert dictionary → loc-key

Optional

-

APNS setting

The key for a localized message string.

alertObj.loc-args

Array of strings

the aps dictionary → alert dictionary → loc-args

Optional

-

APNS setting

An array of strings containing replacement values for variables in your message text. Each %@ character in the string specified by loc-key is replaced by a value from this array. The first item in the array replaces the first instance of the %@ character in the string, the second item replaces the second instance, and so on.

alertObj.subtitle

String

the aps dictionary → alert dictionary → subtitle

Optional

-

APNS setting

Additional information that explains the purpose of the notification.

thread-id

String

aps dictionary → thread-id

Optional

-

APNS setting

An app-specific identifier for grouping related notifications.

category

String

aps dictionary → category

Optional

-

APNS setting

The notification’s type.

target-content-id

String

aps dictionary → target-content-id

Optional

-

APNS setting

The identifier of the window brought forward.

collapseKey

String

apns-collapse-id in request header.

Optional

-

APNS setting

silent

boolean

flag corresponds to aps dictionary → content-available

Optional

false

APNS setting

The background notification flag. setting value as true will set content-available as 1.

badge

Integer

aps dictionary → badge

Optional

null

APNS setting

Sets the number to display as the badge of the icon of the application that receives the push notification. If the badge number is 0, the badge is removed from the application icon. If null, the badge is left in its current state. By default, no change is made to the badge.

sound

String

aps dictionary → sound

Optional

no sound is included in the push notification

APNS setting

Sets the name of the sound file to play when the push notification is received.

rich

boolean

flag corresponds to aps dictionary → mutable-content

Optional

false

APNS setting

Sets whether the receiving device may modify the content of the push notification before displaying it.

interruption-level

String

aps dictionary →interruption-level

Optional

-

APNS setting

Indicates the importance and delivery timing of a notification. Possible string values "passive", "active", "time-sensitive", or "critical"

push-type

String

apns-push-type in request header.

Optional

-

APNS setting

Possible string values "alert","background", "complication", "fileprovider", "mdm", "location", "liveactivity", "pushtotalk"

relevance-score

Number

aps dictionary → relevance-score

Optional

-

APNS setting

Setting to sort the notifications from your app. The highest score gets featured in the notification summary

stale-date

Number

aps dictionary key → stale-date

Optional

-

APNS setting

The UNIX timestamp that represents the date at which a Live Activity becomes stale, or out of date.

content-state

Dictionary

aps dictionary key → content-state

Optional

-

APNS setting

The updated or final content for a Live Activity.

timestamp

Number

aps dictionary key → timestamp

Optional

-

APNS setting

The UNIX timestamp that marks the time when you send the remote notification that updates or ends a Live Activity.

event

String

aps dictionary key → event

Optional

-

APNS setting

The string that describes whether you start, update, or end an ongoing Live Activity with the remote push notification. To start the Live Activity, use start. To update the Live Activity, use update. To end the Live Activity, use end.

dismissal-date

Number

aps dictionary key → dismissal-date

Optional

-

APNS setting

The UNIX timestamp that represents the date at which the system ends a Live Activity and removes it from the Dynamic Island and the Lock Screen.

attributes-type

String

aps dictionary key → attributes-type

Optional

-

APNS setting

A string you use when you start a Live Activity with a remote push notification.

attributes

Dictionary

aps dictionary key → attributes

Optional

-

APNS setting

The dictionary that contains data you pass to a Live Activity that you start with a remote push notification.

customFields

Object

Specify custom payload values outside the Apple-reserved aps namespace.

Optional

-

Custom values

Must use the JSON structured and primitive types: dictionary (object), array, string, number, and Boolean