The method for adding custom action buttons to push notifications varies depending on the target platform (mobile vs. web). For mobile applications, this is primarily handled within your app's code, while for web push, it can be configured in the Control Panel.
For Mobile Apps (iOS & Android)
For mobile platforms, button configuration is managed at the application code level to leverage native features and localization.
Android:
Custom buttons are implemented using the Notification Factory service within your Android application.
- The buttons, including their text, icons, and actions, are defined directly in your application's code.
- When you send a push, you only need to include data in the payload that tells your app which pre-defined buttons to display.
- Localization is handled automatically by the Android OS using your app's string resources (e.g.,
strings.xml), which will display the button text in the user's device language.
iOS:
For iOS, you should use the Interactive Push feature, also known as Categories.
- Create a "Category" in your Pushwoosh application settings by navigating to Configure > Edit Actions.
- Define the buttons you want to associate with this category.
- When sending a push notification, specify the name of the Category you created.
To support multiple languages, you will need to register these categories within your application's code using localized strings (e.g., NSLocalizedString). The iOS system will then automatically display the correct translation based on the user's device language.
For Web Push (e.g., Chrome)
For web push notifications, you can configure action buttons directly in the Pushwoosh Control Panel using the legacy "Send Push" form.
- Navigate to Channels > Push Notifications.
- Under the Platform settings tab, select the specific web platform (e.g., Chrome).
- Configure the action buttons as needed in the provided fields.
Comments
0 comments
Please sign in to leave a comment.