Notifications
Before you can start using Ably’s push notification services, you must configure the credentials for the third-party services you wish to integrate, such as FCM for Android devices, APNS for iOS devices, or Web Push for web browsers.
- Go to the Firebase Console.
- Click add project and follow the steps to create and manage service account keys.
- Download your service account JSON file.
- In your Ably dashboard, navigate to the notifications tab under your app settings.
- Go to push notifications setup, click configure push.
- Add your service account JSON file to the setting up Firebase cloud messaging section.
- Go to the Apple Developer Program.
- Use the Apple developer portal to create a push notification service certificate for your app.
- Export the certificate as a .p12 file.
- Next, you can either import the .p12 cert or create a PEM file and copy it into your Ably dashboard:
- Import the .p12 file:
- In your Ably dashboard, navigate to the Notifications tab under your app settings.
- Go to push notifications setup, click configure push and scroll to the setting up Apple push notification service section.
- Select the .p12 file you exported and enter the password you created during the export process.
- Click save. You should receive confirmation that the certificate has been successfully imported.
- To further confirm the import, refresh the page and check if the PEM cert and private key text boxes are now populated with the imported key details.
- Create a PEM file from the .p12 file:
- Using OpenSSL, convert the recently exported .p12 file (
io.ably.test.p12
) to a PEM file with the following command:$ openssl pkcs12 -in ./io.ably.test.p12 -out ./io.ably.test.pem -nodes -clcerts
. - Open the PEM file in your text editor.
- Copy everything between and including
-----BEGIN CERTIFICATE-----
and-----END CERTIFICATE-----
, and paste it into the PEM cert text box of the Apple push notification service section of your Ably notifications app dashboard. - Similarly, copy everything between and including
-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----
, and paste it into the PEM private key text box of the same section. Then, click Save.
- Using OpenSSL, convert the recently exported .p12 file (
Push inspector
The Push inspector tool enables you to manually send push notifications by specifying the required data and notification fields. This tool helps test and debug your notification setup before going live.
API key
The API Key authenticates your requests when sending push notifications. Choose from the list of API keys associated with your Ably account. Each key has different permissions and scopes, so ensure you select the correct one for your notification tasks.
Define the content of your push notification using the fields below:
Field | Purpose | How to Use |
---|---|---|
Notification title | A title for the push notification, which will appear as the headline on the user’s device. | Enter a short, clear title that captures the essence of the notification. |
Notification body | The main content of the notification to be displayed below the title. | Write the key information or message that you want the user to read. |
Notification data | Optional JSON data that the app can use for specific actions upon receiving the notification. | Include any extra data needed for app functionality, such as custom metadata or instructions. |
Push notification target
Direct your push notifications to specific targets within the Ably platform. Select the appropriate target according to your notification strategy:
Target | Purpose | How to Use |
---|---|---|
Channel name | Push notifications to all subscribers of a specific channel. | Enter the channel name and click push to channel to notify all devices subscribed to that channel. |
Device ID | Send a notification directly to a specific device. | Enter the Device ID and click push to device to target a single device with the notification. |
Client ID | Notify a specific client registered with Ably. | Enter the Client ID and click push to client to send the notification to the chosen client. |
Push inspector widget
The Push Inspector widget allows you to monitor and manage your push notification infrastructure directly from the Ably dashboard. It provides insights into channel subscriptions, device registrations, and client registrations, making it easier to debug and optimize your notification setup.
Section | Purpose | How to Use |
---|---|---|
Channel subscriptions | View and inspect all channels currently subscribed to push notifications. | Click inspect channel to see detailed information about a specific channel, including the number of subscribers and recent activity. |
Device registrations | Access a list of all devices registered to receive push notifications. | Click inspect device to view detailed information about a specific device, such as its registration status, platform, and recent notifications. |
Client registrations | Get an overview of all clients registered for push notifications within your Ably account. | Click inspect client ID to see detailed information about a specific client, including its subscriptions and recent activity. |