Test A3L Messaging
Test your app by deploying it on Android and Fire OS devices, and sending a test message. This page describes three options for sending a test message: consoles, server-side scripts, and solution-specific APIs.
To send a notification, you need the device ID of the device where you installed your app. For details on how to obtain a device ID, follow the steps in Initialize A3L Messaging.
- Test with consoles
- Test with a server-side script
- Test with solution-specific APIs
- A3L Messaging notification keys
- Troubleshooting
- Related resources
Test with consoles
FCM and ADM both have consoles that you can use to send a push notification. If you prefer a UI experience, you might want to use this method.
Test your app with the ADM console
To test your integration with ADM, you can send a push notification by using the ADM console and following these directions.
- Go to the ADM console and log in if prompted.
- Enter the Client ID and secret for your app. You should have these from when you obtained your credentials for ADM.
- In the Device registration ID field, enter the device ID obtained when initializing A3L Messaging.
- Choose Data message.
- Add key-value pairs for the notification you want to send.
- To a title, set Key to "a3l.notification.title" and Value to your desired title of the notification.
- To add a body, set Key to "a3l.notification.body" and Value to your desired text of the notification.
- Optionally, to add an image, set Key to "a3l.notification.image" and Value to a URL to an image.
- Add any additional desired fields. For an exhaustive list of fields and how they map to Android notifications, see A3L Messaging notification keys.
- Choose the duration of the message in the Message expires after section.
- When done adding key-value pairs, click Send test message.
Check for the notification on your device.
You can also send a custom message by choosing your own key-value pairs. You can choose what to name your keys, but make sure they differ from the A3L Messaging notification keys. You must handle custom messages in the onMessageReceived()
method of your implementation of the A3LMessagingService
class.
Test your app with Firebase console
To test your integration with FCM, send a push notification by using the Notification composer in the Firebase console.
- Go to the Firebase console.
- Select the project for which you want to send a test push notification.
- On the left sidebar, expand the Engage section and select Cloud Messaging.
- Click New notification.
- Enter your message in the Notification text field. You can optionally fill in the Notification title, Notification image or Notification name fields.
- Click Send test message in the Device preview section.
- In the overlay, enter your device ID in the Add an FCM registration token field. Your device ID was obtained when initializing A3L Messaging.
- Click Test.
Your app should receive the push notification.
Test with a server-side script
The following server-side scripts allow you to send notifications to a device.
- ADMWebServer.py is a python script that sends a notification to a Fire OS device.
- FCMWebServer.py is a python script that sends a notification to an Android device.
Click the following buttons to get the code for the scripts. To send a test notification, copy the code, paste it into an editor, and update the values indicated in the comments. Then save each as a .py file and run the scripts.
Test with solution-specific APIs
Both FCM and ADM provide APIs you can use to send messages to your devices. For detailed instructions on how to send a message through those APIs, use the following guides.
A3L Messaging notification keys
A3L Messaging notification keys are similar to Android notification keys. All A3L Messaging notification keys append a prefix of "a3l.notification." before the base field name. This prefix helps to avoids collision with the Android notification keys which have similar field names.
A3L Messaging notification fields behave same as the corresponding Android notification fields. The data type and functionality of the fields are the same. The following table shows a full list of A3L Messaging notification fields and the corresponding Android notification fields.
A3L Messaging notification field | Android notification field |
---|---|
a3l.notification.title | title |
a3l.notification.body | body |
a3l.notification.image | image |
a3l.notification.icon | icon |
a3l.notification.color | color |
a3l.notification.sound | sound |
a3l.notification.tag | tag |
a3l.notification.click_action | click_action |
a3l.notification.channel_id | channel_id |
a3l.notification.sticky | sticky |
a3l.notification.event_time | event_time |
a3l.notification.local_only | local_only |
a3l.notification.notification_priority | notification_priority |
a3l.notification.default_sound | default_sound |
a3l.notification.visibility | visibility |
a3l.notification.notification_count | notification_count |
Troubleshooting
If while using an emulator device, A3L crashes with a No Valid Platform Found error, the emulator might not have Google Play services installed. In this case, you might need to set up Google Play services before testing on these devices.
Related resources
Last updated: Feb 27, 2023