I am working on an extension/add-on Firefox for android. Our extension wants to communicate with a native app and fetch data from there. I tried nativeMessaging but it is not supported by Firefox. . While researching, I came across articles discussing Firefox’s 120 build, which is expected to provide enhanced support for add-ons. However, I couldn’t find any information regarding native app messaging in these resources. I’m seeking assistance or guidance from someone who may have insights into this matter.
Hey @diwakar, welcome to the Mozilla Discourse!
You’re correct that the Native Messaging API isn’t supported on Android.
That said, it may be possible for you to achieve your desired result by exposing a local HTTP server in your Android app and having your extension communicate with the app via HTTP requests. If you choose to explore this route, please be careful. It’s possible that another other application on the device may attempt to impersonate either your extension or your Android app.
Another option is to have both your extension and app route messages to each other through a backend server. If you already have systems in place to validate that connections from your Android app and extension are valid, this approach may be preferable since it potentially avoids having to setup up a secure messaging channel between app an extension on device.