Back to all

Android FCM Integration Issue: "median is not defined" – JavaScript Bridge Not Initializing

Hello Median Community,

I am trying to enable Firebase Cloud Messaging (FCM) push notifications in my Android application, MediFast, built using Median App Studio.

However, I am facing an issue where the Median JavaScript Bridge does not appear to initialize inside the Android WebView.

App Information

  • App Name: MediFast
  • Android Package: "co.median.android.wexaxby"
  • Platform: Android
  • Firebase Project ID: "medifast-mobile-app"

FCM Plugin Configuration

  • Plugin Enabled: Yes
  • Automatic Registration: Enabled
  • Show Foreground Notifications: Enabled
  • Correct "google-services.json" uploaded under Build & Deploy → Google Services → Android.

Errors

When I open the Median Firebase Messaging Demo inside my app and click CHECK PERMISSION, I receive:

checkPermission failed
median is not defined

When clicking GET TOKEN, I receive:

getToken failed
median is not defined

JavaScript Bridge Test

I also tested:

https://median.dev/library-ready/

inside my Android app.

Unfortunately:

  • No library-ready alert appears.
  • The status bar does not turn blue.
  • The "median_library_ready" callback does not execute.

Troubleshooting Already Completed

  1. Verified Firebase project and Android package configuration.
  2. Confirmed Firebase Cloud Messaging API (V1) is Enabled.
  3. Enabled the FCM plugin in Median App Studio.
  4. Cleared the JavaScript Bridge Allowed URLs setting.
  5. Set the "https://median.dev" Link Handling Rule to Internal.
  6. Built and installed a fresh APK after enabling FCM.
  7. Fully closed and relaunched the application.

The problem still persists.

Questions

  1. Why is the Median JavaScript Bridge not being injected or initialized in my Android WebView?
  2. Is there any additional configuration required to enable the bridge?
  3. Could there be an issue with the Android build or native bridge integration?
  4. How can I properly initialize the bridge and obtain an FCM registration token?

I would appreciate help from the Median technical team or anyone who has successfully resolved a similar issue.

Thank you!