Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Updated 5 March 2021
In this blog, we will learn about passing Information from Java to JavaScript in our React Native Application.
Well, react native has a huge community and makes everything easy especially for cross-platform developments (both Android & iOS).
As a result, most of the problems a beginner developer will face have already been posted and resolved over the internet.
But sometimes we just want to do a few things in the Android Code and then pass on this to the javascript.
Let’s see how we can do this
First, we will just have a look at the Android Side Changes
Let’s just say I want to Transfer a String to javascript code from our MainActivity.
With this, you are able to emit an event from your native java to javascript.
But Still, you will not be able to receive this event in your javascript code as you have not subscribed to this event.
So, now let’s just have a look at the javascript side changes you need to make.
Let’s say I want to receive this event in my App.js file.
Hope this helps you.
Keep coding and Keep Sharing 🙂
References : 1) https://facebook.github.io/react-native/docs/native-components-android#events
2) https://levelup.gitconnected.com/react-native-events-in-gory-details-what-happens-on-the-way-to-listeners-2cee6c55940c
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.