5. Providers

Providers availability depends on the deployed binaries, by default Tigase includes following providers:

5.1. Tigase Push Component - FCM provider

5.1.1. Overview

Tigase Push Component - FCM provider is an implementation of FCM provider for Tigase Push Component. It allows Tigase Push Component to connect to Firebase Cloud Messaging and send notifications using this service.

5.1.2. Configuration

5.1.2.1. Enabling provider

To enable this provider, you need to enable fcm-xmpp-api bean within push component configuration scope.

Example.

push () {
    'fcm-xmpp-api' () {
        # FCM configuration here
    }
}

Note

You need to pass FCM configuration parameters to make it work, see below.

5.1.2.2. Setting FCM credentials

FCM XMPP API provider will not work properly without API key and project id as this values are required for authorization by FCM. You need to get information from FCM account.

When you have this data, you need to pass sender id as sender-id property and server key as server-key property.

Example.

push () {
    'fcm-xmpp-api' () {
        'sender-id' = 'your-sender-id'
        'server-key' = 'your-server-key'
    }
}

5.1.2.3. Connection pool

By default this provider uses single client to server connection to FCM for sending notifications. If in your use case it is to small (as you need better performance), you should adjust value of pool-size configuration property. Setting it to 5 will open five connections to FCM for better performance.

Example.

push () {
    'fcm-xmpp-api' () {
        'pool-size' = 5
    }
}

5.2. Tigase Push Component - APNs provider

5.2.1. Overview

Tigase Push Component - APNs provider is an implementation of APNs provider for Tigase Push Component. It allows Tigase Push Component to connect to Apple Push Notification service and send notifications using this service.

5.2.2. Configuration

5.2.2.1. Enabling provider

To enable this provider, you need to enable apns-binary-api bean within push component configuration scope.

Example.

push () {
    'apns-binary-api' () {
        # APNs configuration here
    }
}

Note

You need to pass APNs configuration parameters to make it work, see below.

5.2.2.2. Setting APNs credentials

APNs binary API provider will not work properly without credentials allowing it to connect and authenticate to APNs.

This can be done either by providing certificate files (including certificate files for accessing PushKit, if VoIP notifications need to be available) or by providing P8 encryption key.

Usage of P8 private encryption key is preferred way of authentication as a single key allows you to send push notifications (including PushKit notifications) and this private key doesn’t expire, so you do not need to renew it.

6. P8 encryption key

The P8 private encryption key required for authorization by APNs you need to obtain using Apple Developer Account. You also need to know your team ID and downloaded key ID.

Note

Apple provides you with only a single private key. This key can be downloaded only once and needs to be shared between installations sending push notifications. (Actually, you can have 2 encryption keys, but according to the documention, second key should be created only for updating all instances to use new key without stopping not updated instances from sending push notifications due to expired/cancelled key).

When you have that, you need to pass encryption key file as key-file, encryption key ID as key-id, team ID as team-id and APNS topic (bundle id) as apns-topic.

Example for /etc/apns-private-key.p8, XMXXXXU5XC, XXXXW6EXXX and com.bundle.id.

push () {
    'apns-binary-api' () {
        'key-file' = '/etc/apns-private-key.p8'
        'key-id' = 'XMXXXXU5XC'
        'team-id' = 'XXXXW6EXXX'
        'apns-topic' = 'com.bundle.id'
    }
}

Alternatively, P8 private key can be stored in the database and in that case the TDSL configuration file should only contain 'apns-topic' entry and the private key, the key id and team id should be updated via ad-hoc command (Service discovery → Push component → Set APNS encryption key). In the ad-hoc you should select the APNS provider from the list and include private key (P8 form/content of P8 file) obtained from Apple.

7. Certificate files

The certificate file required for authorization by APNs and password to decrypt this certificate file you need to obating using Apple Developer Account.

When you have this certificate, you need to pass path to certificate file as cert-file property, password as cert-password and APNS topic (bundle id) as apns-topic.

Example for /etc/apns-cert.p12, Pa$$word and com.bundle.id.

push () {
    'apns-binary-api' () {
        'cert-file' = '/etc/apns-cert.p12'
        'cert-password' = 'Pa$$w0rd'
        'apns-topic' = 'com.bundle.id'
    }
}

Alternatively, certificate can be stored in the database and in that case the TDSL configuration file should only contain 'apns-topic' entry and the certificate and the password should be updated via ad-hoc command (Service discovery → Push component → Set APNS certificate). In the ad-hoc you should select the APNS provider from the list and include base64 encoded certificate obtained from Apple (.p12 file), for example:

base64 -w 0 PushCertificate.p12