react-native-dev-menu-on-touch icon indicating copy to clipboard operation
react-native-dev-menu-on-touch copied to clipboard

Android support?

Open jenskuhrjorgensen opened this issue 5 years ago • 3 comments

Is it correct, that this module doesn't work for Android? I couldn't find anything in your README that said so.

I get null is not an object (evaluating 'DevMenu.show') and when looking into NativeModules it looks like DevMenu is only available on iOS.

jenskuhrjorgensen avatar Jul 24 '19 10:07 jenskuhrjorgensen

I'd be happy to add it, but I don't know if there is a way to do that on Android

pie6k avatar Nov 06 '19 09:11 pie6k

If you install the react-native-dev-menu-android you adds a bridge of the DevMenu to react native in Android.

I developed a similar library to this one that forced me to develop this native module to provide compatibility with android.

franciscomorais avatar May 01 '20 18:05 franciscomorais

Doing this provides access to the dev menu and the method to open a dev menu.

 ReactApplication application = (ReactApplication)getReactApplicationContext()
      .getCurrentActivity()
      .getApplication();

    mDevMenu = application
      .getReactNativeHost()
      .getReactInstanceManager()
      .getDevSupportManager();
...
mDevMenu.showDevOptionsDialog(); // Here

Using this on a menu modification I made to allow me to add anything I want to the developer menu and also have it work in QA builds if need be.

mikehuebner avatar May 06 '20 18:05 mikehuebner