Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 30346

How do I Expose a React Method on an Android Activity with a ReactRootView so it can be Called From React Native Javascript?

$
0
0

I have an existing application on both the iOS and Android platforms. Before I start migrating code completely over to React Native, I am dipping my toe in the water by simply displaying a react view in response to a button press from a native view in the app(s).

Now, I am trying to wire up a native function which I can call from react-native javascript code.

I have already done this successfully using iOS. But I'm not sure how to extend the code from the docs in the page I linked previously to make it work in Android.

I didn't find the React Native docs to be clear enough on how to make this happen on Android.

I have an android app with an activity which I created according to the instructions found in the react-native docs at https://facebook.github.io/react-native/docs/integration-with-existing-apps .

How do I expose the function? and how do I invoke it from Javascript.


Viewing all articles
Browse latest Browse all 30346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>