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
}

Message Object:

Parameter

Type

Description

Required

Defaults

Comments

alertObj.title

String

alert title

Required

-

alertObj.body

String

alert body

Required

-

alertObj.launch-image

String

APNS setting launch-image

Optional

-

alertObj.title-loc-key

String

APNS setting title-loc-key

Optional

-

alertObj.title-loc-args

array

APNS setting title-loc-args

Optional

-

alertObj.subtitle-loc-key

String

APNS setting subtitle-loc-key

Optional

-

alertObj.subtitle-loc-args

array

APNS setting subtitle-loc-args

Optional

-

alertObj.loc-key

String

APNS setting loc-key

Optional

-

alertObj.loc-args

array

APNS setting loc-args

Optional

-

alertObj.subtitle

String

APNS setting subtitle

Optional

-

thread-id

String

APNS setting thread-id

Optional

-

category

String

APNS setting category

Optional

-

target-content-id

String

APNS setting target-content-id

Optional

-

collapseKey

String

APNS setting apns-collapse-id

Optional

-

silent

boolean

APNS setting content-available

Optional

false

badge

Integer

APNS setting badge

Optional

null

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

APNS setting sound

Optional

no sound is included in the push notification

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

rich

boolean

APNS setting mutable-content

Optional

false

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

interruption-level

String

APNS setting that indicates the importance and delivery timing of a notification

Optional

-

Possible string values "passive", "active", "time-sensitive", or "critical"

push-type

String

APNS setting apns-push-type in header.

Optional

-

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

relevance-score

Double

APNS setting to sort the notifications from your app

Optional

-

The highest score gets featured in the notification summary

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

To learn more about how to create and modify JOLT templates please follow up in our developer documentation: push-templates