Push notifications
About push notifications
Our push notifications feature enables you to inform the end-user that something is happening in your app that requires their attention.
This is an optional feature that you can configure in the application configuration. If you enable push, you can also toggle it when initiating the authentication.
Push notifications can be used to improve the end-user experience, but you are not required to use them. They have no impact on the authentication operation itself.
Example use cases
- You want to notify your end-users who are attempting to log in to your website that they have a login request to approve.
- You want to notify your end-user on their mobile device that they have a transaction to authorise.
How to implement push notifications
To implement our push notifications feature, you need to:
Configure the application configuration
To use push notifications, you must first configure it in your application configuration. Once it has been configured, all devices using that application configuration have the ability to receive push notifications.
Prerequisites
Before you start, you need to create an APNs token (iOS) and set up a Firebase project (Android). To learn how to do this, use the buttons below:
Configure push notifications
Once you have completed the prerequisites, you can configure your app to use push notifications.
Currently, you need to configure push notifications for Android and iOS simultaneously.
1. Add APNs token
You need to add the APNs token using the values obtained when you created it in the Apple Developer Program Portal.
To do this:
- See Add APNs provider token in the Encap REST API reference documentation.
- Supply the following values in the request:
Field name Description Name Give the APNs token a name. Description Give the APNs token a description. Key ID Add the Key ID that you obtained when you created the token. Team ID Add your Team ID that you obtained from Membership details. Private key Add the private key from the .p8file that you downloaded when you created the token.
Note: You can open the.p8file using a text editor app.
2. Enable push notifications
You need to enable and configure push notifications in your application configuration.
To do this:
- See Update application configuration in the Encap REST API reference documentation.
- At a minimum, supply the following values in the request:
Property name Required action NATIVE_PUSH_ENABLEDSet this to TRUE.FIREBASE_SERVICE_ACCOUNTAdd the contents of the .jsonkey file obtained in the prerequisite step.apns_uuidAdd the ID of the APNs token that you created. APNS_BUNDLE_IDAdd the bundle ID obtained in the prerequisite step.
To learn more about the configurable properties, see the Push notifications section in our Application configuration documentation.
Configure the mobile SDK
You must also configure the SDK for push notifications. To learn how to do this, read the platform-specific documentation using the buttons below: