Skip to main content
The Cordial plugin integrates mobile push notifications with Cordial, with support for permission prompts, active contact management, and deep-linked opens so notification URLs stay inside the app.

Why use Cordial

  • Push permission management: Request and check notification permission directly from your web UI without leaving the app.
  • Contact registration: Register or update a Cordial contact using a primary key such as email on user sign-in.
  • Contact sign-out: Unset the active contact when the user signs out to ensure clean session handling.
  • In-app deep linking: Configure notification links to open inside the app rather than the system browser.

Prerequisites

  • A Median app with the JavaScript Bridge enabled
  • Cordial account with mobile push configured
  • Deep linking enabled in your Median app settings

When to use this plugin

Use Cordial if your app needs to:

What you’ll do

Use this section as a fast navigation map into the full setup and implementation details:
  1. Enable the plugin: Go to Plugin setup and enable Cordial in Median App Studio.
  2. Configure deep linking: Ensure deep linking is set up so notification links open in-app.
  3. Implement bridge functions: Implement the required methods in JavaScript Bridge functions.
  4. Verify your setup: Complete the Testing checklist and review Troubleshooting notes.

Plugin setup

Enable the plugin

  1. Navigate to Plugins: In App Studio, go to Native Plugins → Push Notifications.
  2. Enable Cordial: Toggle Cordial to enabled status.
  3. Configure deep linking: Ensure your app’s deep link domains include the URLs used in Cordial notification campaigns so links open inside the app.

JavaScript Bridge functions

Prompt for push notification permission

Requests push notification permission. Provide a callback function or otherwise a promise is returned.
Parameters:

Check push notification permission status

Checks the current push notification permission status. Provide a callback function or otherwise a promise is returned.
Parameters:

Set contact

Registers a new user or updates an existing user in Cordial.
Parameters:

Unset contact

Signs out the current user, clearing the active Cordial contact context.

Testing checklist

Use this checklist to ensure Cordial is working correctly in your app:

Basic functionality

  • requestPermission can be called from app code without errors
  • permissionStatus returns a permission result object or value
  • setContact accepts a valid primaryKey and registers the user
  • unsetContact clears the current user state on logout

Platform testing

  • Push permission prompt appears on Android devices
  • Push permission prompt appears on iOS devices
  • Contact registration works on both platforms
  • Contact unset clears state correctly on both platforms

Deep linking

  • Deep linking is configured so notification links open in-app
  • Notification links do not fall back to the system browser

Error scenarios

  • Calling setContact without a primaryKey is handled gracefully
  • Functions are not called before the JavaScript Bridge is ready

Troubleshooting

Cordial bridge functions are undefined or not working

Ensure the JavaScript Bridge is enabled in Median App Studio and that you are calling bridge functions after the page has fully loaded. Also verify that the Cordial plugin is enabled in your app’s plugin configuration in App Studio.

Push permission prompt is not appearing

Check that requestPermission is being called from a user-initiated action such as a button tap. On iOS, the system permission prompt can only be shown once per app install — if the user has already denied permission, they must enable notifications manually in iOS Settings. Use permissionStatus first to check the current state before calling requestPermission.

setContact is not registering the user in Cordial

Verify that the primaryKey value matches the format expected by your Cordial account (typically an email address). Confirm that the Cordial SDK is initialized in your app before the bridge function is called. Check the Cordial dashboard to confirm whether contact records are being created or updated. Deep linking must be configured in your Median app settings for notification URLs to open inside the app. Go to Link Handling → Universal Links / Deep Links / Web Credentials in App Studio and add the domains used in your Cordial notification campaigns, with Universal Links selected.

permissionStatus returns an unexpected value

On iOS, permission states include notDetermined, denied, authorized, provisional, and ephemeral. If the status is denied, the user must re-enable notifications in iOS Settings — requestPermission will not show the prompt again. On Android 13+, ensure the POST_NOTIFICATIONS permission is declared in the app manifest.
Still having trouble?For issues related to Cordial’s own SDK configuration, audience segmentation, or campaign setup outside of Median, refer to Cordial’s integration documentation.
Last modified on November 30, 2026