Questions
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
- Verified Firebase project and Android package configuration.
- Confirmed Firebase Cloud Messaging API (V1) is Enabled.
- Enabled the FCM plugin in Median App Studio.
- Cleared the JavaScript Bridge Allowed URLs setting.
- Set the "https://median.dev" Link Handling Rule to Internal.
- Built and installed a fresh APK after enabling FCM.
- Fully closed and relaunched the application.
The problem still persists.
Questions
- Why is the Median JavaScript Bridge not being injected or initialized in my Android WebView?
- Is there any additional configuration required to enable the bridge?
- Could there be an issue with the Android build or native bridge integration?
- 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!