# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chartbeat.com/cbp/feature-integrations/push-alerts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
