# OneSignal Setup

## Onesignale.com

<https://documentation.onesignal.com/docs/android-firebase-credentials>

## Android Setup

### Step 1 - Create or Open your Firebase Project

Push Notifications require a Firebase Project. If you don't have one setup yet, click **Add project** and follow the directions to setup your project.

If you already have an FCM project, skip to Step 2.

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

### Step 2 - Ensure Firebase Cloud Messaging API (V1) is Enabled:

If you've just created a new project, this should already be enabled by default and you can skip this step. However, if you are using an existing Firebase project, especially an older one, ensure Cloud Messaging API (V1) is enabled.

In your project, click the **Gear icon** next to "Project Overview" in the top left of the left-hand menu and select **Project settings**. Select the **Cloud Messaging** tab.

<figure><img src="/files/FA9bV2GXyujUNMRz4iHF" alt=""><figcaption><p>Firebase gear icon submenu, showing Project Settings</p></figcaption></figure>

If **Firebase Cloud Messaging API (V1)** is disabled, then click the kebab menu icon on the top right corner and open the link.<br>

<figure><img src="/files/eFydLafNjw9iz1R3B7st" alt=""><figcaption><p>Firebase Cloud Messaging API (V1) is disabled in this image. Ensure it is enabled for your project.</p></figcaption></figure>

On the subsequent page, click **Enable**. You may need to wait a few minutes for the action to propagate to Firebase systems.

<figure><img src="/files/PfJfP4WXTevnqeDD0Q13" alt=""><figcaption><p>Enable Firebase Cloud Messaging API v1.</p></figcaption></figure>

### Step 3 - Generate a Private Key JSON file:

Back in your Firebase **Project Settings**, go to the **Service accounts** tab.

Click **Generate new private key** at the bottom of the page.

<figure><img src="/files/sltnJPZatKeucGxgMtUg" alt=""><figcaption><p>Service Accounts section within Firebase</p></figcaption></figure>

You will see a warning window. Click **Generate key**.

<figure><img src="/files/n6sloryOL5MqakhkKtPb" alt=""><figcaption><p>Generate a FCM v1 Key within Firebase</p></figcaption></figure>

Save the JSON file somewhere secure. You will need it shortly.

and click ( **Generate new private key** )

<figure><img src="/files/rpqAFDIp4ytugPNAJaT4" alt=""><figcaption><p>new <strong>file.json</strong></p></figcaption></figure>

### Step 4. Configure Your OneSignal App's Android Platform Settings :

In the [OneSignal dashboard](https://app.onesignal.com/), select your app, then go to:

**Settings > Platforms > Google Android (FCM) > Activate**

<figure><img src="/files/Pp1vNiWcGjpZmeiMBPC4" alt=""><figcaption><p>Platforms screen within OneSignal app settings</p></figcaption></figure>

Next to "Service Account JSON" select **Choose file** and upload the JSON file you downloaded from your Firebase project.

<figure><img src="/files/9YWJayg5hqlHtkOWctCg" alt=""><figcaption></figcaption></figure>

Click **Save and Continue**.

Select the SDK you are using for your app development and click **Save & Continue**.

<figure><img src="/files/rW1pbnAJRYZ6OxdNP8s6" alt=""><figcaption><p>SDK selection screen</p></figcaption></figure>

Select Native Android&#x20;

![Click Native Android](/files/BHx4XaLZ8EQi8JGXEMrv)

![](/files/oqJi0j1q2oaxMSkdEpLw)

### &#x20;Done!

You are now connected to FCM with this OneSignal App and can send push notifications to your Android app. 🥳 Configure Your OneSignal App's Android Platform Settings&#x20;

Update in Admin Panel only

![](/files/1D6Q5DCJVSG0k1oUkgox)

## iOS Setup

### Generate an iOS Push Certificate

Step-by-step guide to create an iOS Push Certificate

An iOS Push Certificate is required for notification delivery to all **iOS** apps.

### Step 1 - Requirements:

* An iOS mobile app. (This is **not for websites / web push**)
* A [Paid Apple Developer Account](https://developer.apple.com/) with [**Admin** Role](https://developer.apple.com/account/#/membership).
* A [OneSignal Account](https://onesignal.com/), if you do not already have one.
* A Mac computer with Xcode 11+
* Your Xcode project should have the Push Notification capability added. Otherwise your project may not be shown in the Apple Developer Center.

### Step 2 - **Create a Certificate Request Manually**:

**2.1 - Request a Certificate From a Certificate Authority**

Open the Keychain Access app on your macOS system. It may be located in **Applications > Utilities > Keychain Access**.

Select **Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority...**

![](/files/-MfT5YAx5Dj9PB0QXt6q)

Next, select the **Save to disk** option and enter your information in the required fields.

This creates a certification request file that will be used later.

![](/files/-MfT5hAcqAzR393wMFHb)

**2.2 - Add Capabilities**

Select **Identifiers** in your Apple Developer Account under [Certificates, IDs & Profiles > Identifiers](https://developer.apple.com/account/ios/identifier/bundle)

![](/files/-MfT5wjZ5SwElX9VvfZs)

Find and select your Identifier to enable Push Notifications, but **do not** click Edit.

If you do not see your Identifier, follow [below Optional - Provisioning Profiles step](https://documentation.onesignal.com/docs/generate-an-ios-push-certificate#optional---provisioning-profiles).

![](/files/-MfT6AqQNdwTSvfMggvi)

**2.3 - Select Push Notification Certificate**

Next, go to [Certificates](https://developer.apple.com/account/resources/certificates/add) and create a new certificate by clicking the blue **+** (plus) button.

Under **Services**, select **Apple Push Notification service SSL (Sandbox & Production)** and click Continue.

* The certificate will be applicable to both Sandbox and Production environments, so you do not need a separate key for each one.

![](/files/-MfT6UamQSPVtdq4e4Z8)

**2.4 - Select your App**

Choose your App ID with matching Bundle ID from the App ID pop-up menu, and click Continue.

![](/files/-MfT6av61WGRQiLgrdpm)

**2.5 - Upload your Certificate Signing Request**

Click **Choose File..**, select the **CertSigningRequest** file you saved in **Step 2.1,** click Open, and then click Continue.

![](/files/-MfT6v6HKpPag7eAj3q3)

Click Download to save the certificate to your computer.

![](/files/-MfT71csu6aT1Dco6S-2)

**2.6 - Creating a Private Key**

Open the `.cer` file you downloaded in the last step by double-clicking on it in Finder.

![](/files/-MfT79NxaiN49LNe4keb)

After a few seconds, the Keychain Access program should open. Select **Login > My Certificates**, then right-click on your Apple Push Services key in the list and select **Export "Apple Push Services...**.

![](/files/-MfT7GqIHsit15IRQMbb)

Give the file a unique name using the `.p12` extension, and click Save. You will have an option to protect the file with a password. If you add a password, you need to enter this same password on OneSignal.

### Step 3 - Upload Your Push Certificate to OneSignal

In the OneSignal dashboard, select your app from the All Apps page, then go to Settings. Under Native App Platforms, click **Apple iOS**.

![](/files/-MfT7RIgUWXBaSKgZq_P)

Select the `.p12` file you exported (along with a password, if you added one) and click Save.

**Note:** If you used the OneSignal Provisionator tool to create a `.p12` file, a password was generated for you, and is located next to the Download button.

![](/files/-MfT7ZgtyJJUdN7ZYA-E)

### Optional - Provisioning Profiles

Usually Required for Cordova/Ionic, and GoNative.

Skip if selected "Automatically manage signing" in Xcode.

![](/files/-MfT7gIFOAdXum2CXW_0)

If you did not select "Automatically manage signing", then follow these steps.

#### Create your Identifier

In your Apple Developer Account, go to **Identifiers** and select the **Blue +** button

![](/files/-MfT7nz-IKad8PRgSDMW)

Select **App IDs** and **Continue**

![](/files/-MfT7q7Z9ImUrLwN36DF)

Select **App** and **Continue**

![](/files/-MfT81tO-Kx_upO0WyPP)

Provide a "Description" and your Explicit "Bundle ID" then press **Continue**

![](/files/-MfT88jsdpKTWRh1h1Z_)

Click **Register**

![](/files/-MfT8GQTklcwC3VpZm1p)

#### Create Your Profile

In your Apple Developer Account, on the left to go to **Profiles**.

![](/files/-MfT8Lm_mwILJ0pEUgqF)

Next find any that are for your app and remove them if they do not have App Groups and Push Notifications in Enabled Capabilities:

![](/files/-MfT8TLfIc95dbfjvyH9)

Create a Profile by pressing the "+" button

![](/files/-MfT8_LGmGkIMX2worbL)

Select the type of profile you need to create and press **Continue**<br>

![](/files/-MfT8eDYes2V97Z6F_EW)

Search for your App ID, if you do not see your App ID, check the [Create Your Identifier](https://documentation.onesignal.com/docs/generate-an-ios-push-certificate#create-your-identifier) step above.

Then press **Continue**.

![](/files/-MfT8lS75mBOBAk1awCW)

Select the Development or Distribution Certificate to associate with the Profile. Then click **Continue**.&#x20;

![](/files/-MfT8tYD_QsyMB5tpShV)

### Config Badge

<https://documentation.onesignal.com/docs/badges#ios-badge-behavior>


---

# 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://positifmobile.gitbook.io/flyweb/config/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.
