# 3.3 OneSignal Setup

### 3.1.1 Android Setup for Onesignal

1. Create your Onesignal account from [here](https://dashboard.onesignal.com/) or use your existing Onesignal account and create an app.

<figure><img src="/files/x6pj6jjGZQ8mgWzLJ1Uc" alt=""><figcaption></figcaption></figure>

2. Enter your app name select Google Android FCM and click on Next.

<figure><img src="/files/kXO6AZv65uMqglNIKQnW" alt=""><figcaption></figcaption></figure>

3. For the next step, you need to download your **Firebase Admin SDK** from your Firebase project. Follow [<mark style="color:purple;">this (2 & 3)</mark>](https://documentation.onesignal.com/docs/android-firebase-credentials) to download the file and upload the JSON file here.

<figure><img src="/files/5WwAoa2gQJk6DXtuQqAJ" alt=""><figcaption></figcaption></figure>

4. In the next step, select **Flutter** as your target SDK.

<figure><img src="/files/t1AlrAAgx9jvic6zBBjA" alt=""><figcaption></figcaption></figure>

5. Click Save and Done to complete the Android setup.

### 3.1.2 iOS Setup for Onesignal

1. From 3.2, you will get your key (.p8 file) from your Apple developer account. For more details, you can check [this](https://documentation.onesignal.com/docs/ios-p8-token-based-connection-to-apns) out.
2. From Onesignal > Your app > Settings > Platforms, Select **Apple iOS.**

<figure><img src="/files/Mdr7CYMxFjQ9tUWHWG3k" alt=""><figcaption></figcaption></figure>

3. Now, upload your key, Key ID, Team ID, and iOS package name.

<figure><img src="/files/Ic6g7lvtxP1xdJHkQTKp" alt=""><figcaption></figcaption></figure>

4. Select Flutter as Your SDK if you get any sdk steps after this.
5. Save and activate this configuration.

### 3.1.3 WordPress Setup for Onesignal

1. From your WordPress Dashboard > Onesignal Push > Configuration, Add your **Onesignal App ID**, and **Rest API key**.

{% hint style="info" %}
You can get both the **Onesignal App ID** and **Rest API key** from your Onesignal Account > Your app > Settings > Keys & IDs.
{% endhint %}

<div align="left"><figure><img src="/files/HYLe3HEgyGm0PQ5kOfKq" alt=""><figcaption></figcaption></figure></div>

2. **Enable** Send notifications additionally to iOS & Android Platforms.
3. Save the configurations.

After this setup, you will get an option in your editor to send notifications on post updates.

<figure><img src="/files/CkgukbD1ThJJTkuK8KB8" alt=""><figcaption></figcaption></figure>

### 3.1.4 Update OneSignal App ID in the code

From Onesignal > Your app > Settings > Keys & IDs, You will get your **Onesignal App ID**. Copy this and update the ID in the **lib/config/config.dart** file.


---

# 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://doc.newsfreak.mrb-lab.com/app-setup/3.-push-notification-setup/3.3-onesignal-setup.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.
