> For the complete documentation index, see [llms.txt](https://developer.tryreferd.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.tryreferd.com/installing-referd/referd-for-react/handling-push-notifications-on-react-native.md).

# Push Notifications

Referd uses Firebase to deliver maximum experience in your app. This includes push notifications, interactive in-app messaging.

![](/files/CWYBKKkmVUtMiXAfsnHX)

### Configure Referd With Your Firebase

Before you start, you must configure your Firebase on your **Referd** account. Follow the steps in [Configure your Firebase account on Referd for mobile push notifications](https://help.tryreferd.com/en/articles/8668480-get-your-referd-integration-details) article from our Help Center related to push notifications.

### Handling Push Notifications Integration

For notifications handling, add this code to the **`onNotification`** function in your app:

```typescript
onNotification: (notification) => {
// you need to check the platform because firebase send the notification based on the platform

if (Platform.OS === 'android') { // Android
          if(notification.isGB){
                  // send notification direct to InAppNotification as described below
          }
        }
        else { // IOS
          if (notification.data.isGB) {
                  // send notification.data to InAppNotification as described below
          }
        }
}
```

Import **InAppNotification**

```typescript
import {InAppNotification} from 'react-native-gameball';
```

**InAppNotification** takes the following properties:

| Parameter      | Required     | Description                                         | Type         |
| -------------- | ------------ | --------------------------------------------------- | ------------ |
| `notification` | **Required** | Pass the notification data received from the server | Notification |

You can use it in different two ways: one is by adding it directly underneath the main app like shown.

```jsx
<Provider>
    <AppNavigator>
    <InAppNotification 
      notification={this.props.notification}
    />
</Provider>
```

Another approach is to have a separate component which handles the InAppNotification component and pass to it the data directly.

{% code title="SeparateComponent.tsx" %}

```jsx
render(){
    return(
    <InAppNotification
        readnotification={this.props.notification}
    />
   )
}
```

{% endcode %}

After that, add it underneath your main app component as follows.

```jsx
<Provider>
        <AppNavigator />
        <SeparateComponent/>
</Provider>
```

Your users can now receive push notifications from **Referd**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.tryreferd.com/installing-referd/referd-for-react/handling-push-notifications-on-react-native.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
