> For the complete documentation index, see [llms.txt](https://docs.chartbeat.com/cbp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chartbeat.com/cbp/feature-integrations/push-alerts.md).

# 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](http://support.chartbeat.com/docs/sdk.html).

Beginning with Chartbeat iOS SDK version [1.3.0](https://cocoapods.org/pods/Chartbeat), Android SDK version [1.4.0](https://bintray.com/chartbeat-labs/maven/com.chartbeat.androidsdk), and React Native SDK version [1.0.2](https://www.npmjs.com/package/chartbeat-react-native-bridge-sdk), the Chartbeat Native App Integration provides support for tracking push notifications.

<figure><img src="/files/CvPUyUkaiXMIKYM1Xxrw" alt="" width="283"><figcaption></figcaption></figure>

### setPushReferrer() Method <a href="#method" id="method"></a>

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 <a href="#ios" id="ios"></a>

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

#### Objective-C:

```
[[CBTracker sharedTracker] setPushReferrer:@"your_push_id"];
```

#### Swift:

```
CBTracker.shared().setPushReferrer("your_push_id")
```

### Android <a href="#android" id="android"></a>

Set metadata — including `setPushReferrer` — **after** `trackView()`, because view changes purge metadata.

#### Java

```
Tracker.setPushReferrer(“your_push_id”);
```

### React Native <a href="#android" id="android"></a>

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

```
Chartbeat.setPushReferrer('your_push_id');
```

### Push Vendors <a href="#vendors" id="vendors"></a>

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.
