You can do this by combining custom app logic with the SDK. The process involves sending specific data in the notification and updating user tags when the app receives that data.
Set up the notification payload
Include a deep link or custom data in your push notification payload. For example, you can add an event ID or a category name. On iOS, you can also set up notification categories to show action buttons like Unsubscribe directly on the lock screen.
Handle the interaction in your app
When a user taps the notification or an action button, your app needs to read the custom data or the deep link. You must write code to detect this specific action and identify which event the user wants to leave.
Update user preferences
Pushwoosh tracks user preferences through tags. Once your app identifies the unsubscription request, call the setTags method to update the user profile. You can manage these preferences in two ways:
- Use boolean tags to set a specific event category to false.
- Use list tags to remove an event ID from an array of active subscriptions.
Comments
0 comments
Please sign in to leave a comment.