For the complete documentation index, see llms.txt. This page is also available as Markdown.

Push Alerts

Chartbeat’s Mobile SDK integrates Chartbeat analytics with your native iOS or Android app. This page includes documentation for functionality of an updated SDK release candidate with support for push-alert referrers. For general SDK documentation, please reference this page.

Beginning with Chartbeat iOS SDK version 1.3.0, Android SDK version 1.4.0, and React Native SDK version 1.0.2, the Chartbeat Native App Integration provides support for tracking push notifications.

setPushReferrer() Method

When your app responds to push notifications, use the setPushReferrer() method to set an identifier for the notification received. The identifier specified will be sent along with an indicator that the referrer is a push notification. These push notifications and their ids will be viewable in the real-time dashboard.

Below are sample snippets for how Chartbeat implemented this method in iOS, Android, and React Native apps.

iOS

Call setPushReferrer() method with the ID of the push alert before the trackView() call.

Objective-C:

Swift:

Android

Set metadata — including setPushReferrerafter trackView(), because view changes purge metadata.

Java

React Native

Set article metadata after setupTracker and before trackView (or between views, as the article changes).

Push Vendors

The push identifiers for each vendor will vary slightly. You can follow your vendor’s documentation for retrieving the push identifier to add to the Chartbeat SDK for each application.

Last updated

Was this helpful?