Support Home > SDK Integration > Flutter – SDK Integration > Flutter – Push Notification

Flutter – Push Notification

Estimated Time to Complete
15 Minute

Kochava Push Engagement provides the ability to target desired user segments in order to send meaningfully designed messages. See the Engagement Overview documentation for more information.

In order to integrate with Kochava Push you must, at a minimum, enable push notifications by passing the user’s push registration token to the Kochava SDK and handle app launches from a Kochava push notification by sending a Push Opened event containing engagement campaign information. This document assumes you have already integrated your platform’s push notification support and enabled Push on the Kochava Dashboard.

Enabling Push Notifications

In order to enable Kochava push notifications you must pass the push registration token to the Kochava SDK. This will occur the first time the token is created and any time it is updated. If you support opt in or out then this should only occur when the user is currently opted in and during the moment they opt in.


Example (Standard Event with Standard Parameters)

Handling App Launches

When the app launches you must detect if it was caused by the user clicking on a Kochava push notification and if so send a Push Opened event containing the Kochava engagement campaign information to track the launch.


Example (Send Push Opened Event)

Building the Notification

Android Only:

On Android, Kochava Push uses the FCM Data Message format. This format ensures consistent behavior regardless of if the app is in the foreground or the background. However it requires that the app is responsible for building and displaying the notification when it is received. The app must also determine if it should show the notification based on being in the foreground or background. The “kochava” key contains the engagement campaign information and is always included. Other fields are optional and may vary.

  1. kochava — Campaign tracking information to be added to the notification bundle and sent with the Push Opened event.
  2. silent — If this key is present the push was used for tracking uninstalls and should be ignored.
  3. title — Notification title.
  4. message — Notification message body.
  5. icon_resource_id — Mapping string to an app internal drawable resource.
  6. link — Launch deeplink Uri.


Example (Building the Notification)

Other Functionality

Disabling Push Notifications:

If you provide the ability for users to opt in or out of Kochava Push Notifications you can remove an existing push token which will disable usage of that token by Kochava. If disabled ensure that you do not pass any updated tokens to Kochava until the feature has been enabled again and if enabled immediately add the current token to the Kochava SDK.


Example (Removing a Push Registration Token)