> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.onesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Median.co (formerly GoNative.io)

> Learn how add push notifications to your converted mobile-friendly website-to-native iOS and Android app with Median.co and OneSignal.

## Overview

If you have a mobile-friendly website and want to convert it into a downloadable mobile app for the Apple App Store or Google Play Store, [Median.co](https://median.co/) is a powerful solution. It also offers a seamless [integration with OneSignal](https://onesignal.com/integrations/median-co) to enable push notifications.

## Setup

### 1. Create your app with Median.co

1. Follow the [Median.co Getting Started Guide](https://median.co/docs).
2. Build an app at [\<https://median.co/app>](https://median.co/app).

### 2. Set up OneSignal

1. Go to [onesignal.com](https://onesignal.com) and create an account.
2. Configure your OneSignal App and Platform.

## Configure your OneSignal app and platform

Configure your OneSignal app with the platforms you support: Apple (APNs), Google (FCM), Huawei (HMS), and Amazon (ADM).

> [!NOTE]
>
> If your organization already has a OneSignal account, [ask to be invited](https://documentation.onesignal.com/docs/en/manage-team-members.md) to the Organization. Otherwise, [sign up for a free account](https://onesignal.com) to get started.

> [accordion] Step-by-step setup instructions
>
> **1. Create or select your app**
>
> Create a new app by clicking **New App/Website**, or add a platform to an existing app in **Settings > Push & In-App**. Select the platform(s) you want to configure and click **Next: Configure Your Platform**.
>
> ![OneSignal dashboard showing the new app setup flow with Organization name, app name, and channel selection](https://mintcdn.com/onesignal/BK2J-grzBpDdh8NC/images/dashboard/new-app-org-channel.png?fit=max\&auto=format\&n=BK2J-grzBpDdh8NC\&q=85\&s=ee0045484152ed15095f619344aa0564)
>
> Setting up your first OneSignal app, Organization, and channel.
>
> **2. Configure platform credentials**
>
> Enter the credentials for your platform:
>
> * **Android**: [Set up Firebase credentials](https://documentation.onesignal.com/docs/en/android-firebase-credentials.md)
> * **iOS**: [p8 token (recommended)](https://documentation.onesignal.com/docs/en/ios-p8-token-based-connection-to-apns.md) or [p12 certificate](https://documentation.onesignal.com/docs/en/ios-p12-generate-certificates.md)
> * **Amazon**: [Generate API key](https://documentation.onesignal.com/docs/en/generate-an-amazon-api-key.md)
> * **Huawei**: [Authorize OneSignal](https://documentation.onesignal.com/docs/en/authorize-onesignal-to-send-huawei-push.md)
>
> Click **Save & Continue** after entering your credentials.
>
> **3. Save your App ID and install the SDK**
>
> Your **App ID** is displayed on the final screen. Copy and save it — you need it when initializing the SDK. Select your SDK platform, then follow the setup guide.
>
> ![OneSignal dashboard showing the App ID and team invite option after setup](https://mintcdn.com/onesignal/VypVshrFHTBZfEma/images/dashboard/app-id-and-team-invite.png?fit=max\&auto=format\&n=VypVshrFHTBZfEma\&q=85\&s=e1e2aab6cca7c4aa6b9a76eff362d5af)
>
> Save your App ID and invite additional team members.

### 3. Link OneSignal to your Median app

Paste the OneSignal App ID into your Median.co (GoNative) app configuration.

***

## Testing the OneSignal SDK integration

This guide helps you verify that your OneSignal SDK integration is working correctly by testing push notifications, subscription registration, and in-app messaging.

### Check mobile subscriptions

**1. Launch your app on a test device.**

The native push permission prompt should appear automatically if you added the `requestPermission` method during initialization.

![](https://mintcdn.com/onesignal/RWtLFPeffHrC81wI/images/docs/a90c2cc443f5fe9e7c80368c680a16cf1ca6203f7b28a0a6eec212add8510f80-Untitled_design_11.png?fit=max\&auto=format\&n=RWtLFPeffHrC81wI\&q=85\&s=96dbf224b3ae93b3d814712cdc5416ba)

iOS and Android push permission prompts

**2. Check your OneSignal dashboard**

Before accepting the prompt, check the OneSignal dashboard:

* Go to **Audience > Users & subscriptions > Subscriptions**.
* You should see a new entry with the status "Never Subscribed".

![](https://mintcdn.com/onesignal/Xl2NHJvxakrK4JbL/images/docs/f19fa5ada3572ce14447bb5639744e9da75cd7a3ab43ecc1a057f2ed92b38e6f-Screenshot_2025-03-16_at_14.55.39.png?fit=max\&auto=format\&n=Xl2NHJvxakrK4JbL\&q=85\&s=b04ca3217e22155841b500a55c7f1511)

Dashboard showing subscription with 'Never Subscribed' status

**3. Return to the app and tap Allow on the prompt.**

**4. Refresh the OneSignal dashboard Subscription's page.**

The subscription's status should now show **Subscribed**.

![](https://mintcdn.com/onesignal/0qspEXXeJ8zJbkJ-/images/docs/85b0376cdcc6f93fb7b3895b18cd1788d2342776d7995909881e5c64dd40fb62-Screenshot_2025-03-16_at_15.57.34.png?fit=max\&auto=format\&n=0qspEXXeJ8zJbkJ-\&q=85\&s=c6abec64d102b84e30f6c9c0327808ef)

Dashboard showing subscription with 'Subscribed' status

> [!TIP]
>
> You have successfully created a [mobile subscription](https://documentation.onesignal.com/docs/en/subscriptions.md).
> Mobile subscriptions are created when users first open your app on a device or if they uninstall and reinstall your app on the same device.

### Set up test users

test users are helpful for testing a push notification before sending a message.

**1. Add to Test Users.**

In the dashboard, next to the subscription, click the **Options (three dots)** button and select **Add to Test Users**.

![](https://mintcdn.com/onesignal/NCUI56Tiw7V-s0dT/images/dashboard/add-to-test-subscriptions.png?fit=max\&auto=format\&n=NCUI56Tiw7V-s0dT\&q=85\&s=2455d4cd74ea4ad686f76730cd95bbaa)

Adding a device to Test Users

**2. Name your subscription.**

Name the subscription so you can easily identify your device later in the **test users tab**.

**3. Create a test users segment.**

Go to **Audience > Segments > New Segment**.

**4. Name the segment.**

Name the segment `Test Users` (the name is important because it will be used later).

**5. Add the Test Users filter and click Create Segment.**

![](https://mintcdn.com/onesignal/NCUI56Tiw7V-s0dT/images/dashboard/create-test-users-segment.png?fit=max\&auto=format\&n=NCUI56Tiw7V-s0dT\&q=85\&s=91b8a021be6e83662854e68ec3e1da04)

Creating a 'Test Users' segment with the Test Users filter

> [!TIP]
>
> You have successfully created a segment of test users.
> We can now test sending messages to this individual device and groups of test users.

### Send test push via API

**1. Get your App API Key and App ID.**

In your OneSignal dashboard, go to **Settings > [Keys & IDs](https://documentation.onesignal.com/docs/en/keys-and-ids.md)**.

**2. Update the provided code.**

Replace `YOUR_APP_API_KEY` and `YOUR_APP_ID` in the code below with your actual keys. This code uses the `Test Users` segment we created earlier.

```curl theme={null}
curl -X \
POST --url 'https://api.onesignal.com/notifications' \
 --header 'content-type: application/json; charset=utf-8' \
 --header 'authorization: Key YOUR_APP_API_KEY' \
 --data \
 '{
  "app_id": "YOUR_APP_ID",
  "target_channel": "push",
  "name": "Testing basic setup",
  "headings": {
  	"en": "👋"
  },
  "contents": {
    "en": "Hello world!"
  },
  "included_segments": [
    "Test Users"
  ],
  "ios_attachments": {
    "onesignal_logo": "https://avatars.githubusercontent.com/u/11823027?s=200&v=4"
  },
  "big_picture": "https://avatars.githubusercontent.com/u/11823027?s=200&v=4"
}'
```

**3. Run the code.**

Run the code in your terminal.

**4. Check images and confirmed receipt.**

If all setup steps were completed successfully, the test users should receive a notification with an image included:

![](https://mintcdn.com/onesignal/Z6xkXGfmy814If53/images/docs/e4e3e812eb6841ff11795a6ee0ea36eff483920ea9266733d6948ed34df3def3-Untitled_design_9.png?fit=max\&auto=format\&n=Z6xkXGfmy814If53\&q=85\&s=9bf6f4a73e38ec424b8cfec75a474a26)

Push notification with image on iOS and Android

> [!NOTE]
>
> Images will appear small in the collapsed notification view. Expand the notification to see the full image.

**5. Check for confirmed receipt.**

In your dashboard, go to **Messages > All messages**, then click the message to view stats.

You should see the **confirmed** stat, meaning the device received the push.
\[!TIP] You have successfully sent a notification via our API to a segment.

> [!WARNING]
>
> * No image received? Your [Notification Service Extension](#ios-setup) might be missing.
> * No confirmed receipt? Review your [App Groups setup](#ios-setup).
> * Having issues? Copy-paste the api request and a log from start to finish of app launch into a `.txt` file. Then share both with `support@onesignal.com`.

### Send an in-app message

[In-app messages](https://documentation.onesignal.com/docs/en/in-app-messages-setup.md) let you communicate with users while they are using your app.

**1. Close or background your app on the device.**

This is because users must meet the in-app audience criteria *before* a new session starts. In OneSignal, a new session starts when the user opens your app after it has been in the background or closed for at least 30 seconds. For more details, see [how in-app messages are displayed](https://documentation.onesignal.com/docs/en/in-app-messages-setup.md) and [Sessions](https://documentation.onesignal.com/docs/en/sessions.md).

**2. Create an in-app message.**

* In your OneSignal dashboard, navigate to **Messages > In-App > New In-App**.
* Find and select the **Welcome** message.
* Set your Audience as the **Test Users** segment we used previously.

![](https://mintcdn.com/onesignal/3zq1PvSaqvUE2bIx/images/docs/2979dfb2c6e0711669ebe737d78d975dcfed9f8117bdd68846255b9fc91e4771-Screenshot_2025-03-17_at_14.56.23.png?fit=max\&auto=format\&n=3zq1PvSaqvUE2bIx\&q=85\&s=f705ee679a9248dab378305e15fa24bf)

Targeting the 'Test Users' segment with an in-app message

**3. Customize the message content if desired.**

![](https://mintcdn.com/onesignal/YOTSrtBSoqdrJ37A/images/docs/4c511ebdb04f33055556b9969bab8deee0d62154573cf0b41ffb25cc8431e7c0-Screenshot_2025-03-17_at_14.59.37.png?fit=max\&auto=format\&n=YOTSrtBSoqdrJ37A\&q=85\&s=6134cc70e578d1055f770edcbad47efb)

Example customization of in-app Welcome message

**4. Set Trigger to 'On app open'.**

**5. Schedule frequency.**

Under **Schedule > How often do you want to show this message?** select **Every time trigger conditions are satisfied**.

![](https://mintcdn.com/onesignal/9_Q1FZLh6C0BFLq-/images/docs/c48ccaf33a74d5aa442c768a18b8e642024b89305aae665d613aee1d8bde43ec-Screenshot_2025-03-17_at_15.00.40.png?fit=max\&auto=format\&n=9_Q1FZLh6C0BFLq-\&q=85\&s=9a57431acffa267d22af4e19052fb5ee)

In-app message scheduling options

**6. Make message live.**

Click **Make Message Live** so it is available to your Test Users each time they open the app.

**7. Open the app and see the message.**

After the in-app message is live, open your app. You should see it display:

![](https://mintcdn.com/onesignal/RWtLFPeffHrC81wI/images/docs/a7ed4bb02be56900a65d2519e3d69f9c9b2c2a1c65fe740f07789e4ffe79cd67-Untitled_design_10.png?fit=max\&auto=format\&n=RWtLFPeffHrC81wI\&q=85\&s=6f692b569706ca39df0b4cc2b70f3de2)

Welcome in-app message shown on devices

> [!WARNING]
>
> Not seeing the message?
>
> * Start a new session
>   * You must close or background the app for at least 30 seconds before reopening. This ensures a new session is started.
>   * For more, see [how in-app messages are displayed](https://documentation.onesignal.com/docs/en/in-app-messages-setup.md).
> * Still in the `Test Users` segment?
>   * If you reinstalled or switched devices, re-add the device to [Test Users](#set-up-test-users) and confirm it's part of the Test Users segment.
> * Having issues?
>   * Follow [Getting a Debug Log](https://documentation.onesignal.com/docs/en/capturing-a-debug-log.md) while reproducing the steps above. This will generate additional logging that you can share with `support@onesignal.com` and we will help investigate what's going on.

> [!TIP]
>
> You have successfully setup the OneSignal SDK and learned important concepts like:
>
> * Gathering [Subscriptions](https://documentation.onesignal.com/docs/en/subscriptions.md), setting [Test Users](https://documentation.onesignal.com/docs/en/test-users.md), and creating [Segments](https://documentation.onesignal.com/docs/en/segmentation.md).
> * Sending [Push](https://documentation.onesignal.com/docs/en/push.md) with images and [Confirmed receipt](https://documentation.onesignal.com/docs/en/confirmed-delivery.md) using Segments and our [Create message](https://documentation.onesignal.com/reference/create-message.md) API.
> * Sending [In-app messages](https://documentation.onesignal.com/docs/en/in-app-messages-setup.md).

***

## Prompt for push permissions

Instead of calling `requestPermission()` immediately on app open, take a more strategic approach. Use an in-app message to explain the value of push notifications before requesting permission.

For best practices and implementation details, see our [Prompt for push permissions](https://documentation.onesignal.com/docs/en/prompt-for-push-permissions.md) guide.

***

## FAQ

### How can I access OneSignal data on the client side?

Use the Median Native JavaScript Bridge method `median_onesignal_info` to retrieve the OneSignal Subscription ID (`oneSignalUserId`) and the subscription status.

```javascript javascript theme={null}
  var osSubscriptionId = "the OneSignal Subscription ID string";
  var isSubscribedToPushNotifications;

  median.onesignal.onesignalInfo().then(function (oneSignalInfo) {
    console.log(oneSignalInfo);
    osSubscriptionId = oneSignalInfo.oneSignalUserId;
    isSubscribedToPushNotifications = oneSignalInfo.oneSignalSubscribed;
  });
```

> [!NOTE]
>
> More details in [Median.co Docs](https://median.co/docs/onesignal-info)

### How do I send deep link push notifications to my Median app?

Median apps use deep linking for a native experience instead of opening a pop-up browser.

#### When using OneSignal dashboard:

* **Do not** use the **Launch URL** field.
* Instead, use the **Additional Data** field.
  * Add a key: `targetUrl` (capital “U”)
  * Add a value: the URL you want users to open.

![](https://mintcdn.com/onesignal/Z6xkXGfmy814If53/images/docs/e5778f7-image.png?fit=max\&auto=format\&n=Z6xkXGfmy814If53\&q=85\&s=7989c4fd92d1179e72e5cfd6a8cbf575)

Using Additional Data with targetUrl

#### When using the REST API:

Include `targetUrl` in the `data` object of your push payload. Example:

```json theme={null}
{
  "app_id": "YOUR-APP-ID",
  "include_player_ids": ["USER-ID"],
  "data": { "targetUrl": "https://example.com/page" },
  "contents": { "en": "Check out this page!" }
}
```

#### Sending to both web and mobile?

If you send to web and mobile simultaneously:

In the Launch URL section, select “Different URL for web/app”.

Leave the APP URL field blank to prevent override.

![](https://mintcdn.com/onesignal/56ctKxZSV4m5VEkn/images/docs/b0391bc-image_1.png?fit=max\&auto=format\&n=56ctKxZSV4m5VEkn\&q=85\&s=130176d2fc8d8172c594828aacdcb4c2)

Configuring different URLs for web and mobile

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.