Android App Development
iOS 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
Owner and Founder. Opencart
Top Partners
In this blog, I am implementing ToastModule functions and how to use those functions in our React Native Application.
In my previous blog, we know that how to create a React native Library and how to import in our Existing Application? Now, I am lighting my previous blog for What is the Module?
The module is a very important thing in our development, By using module we split our problems into many parts or we can generalize our problems into a specific form. In this blog, I will focus on how to create a module in the react-native project and how to implement it on our existing project manually.
How to create a Module?
-> Please click on the link to open my previous blog to create a module
https://mobikul.com/creating-module-for-react-native/
Steps-
ReactContextBaseJavaModule require a method called getName. The purpose of this method is to return the string name of the NativeModule which represents this class in JavaScript.
NativeModule
An optional method called getConstants returns the constant values exposed to JavaScript. Its implementation is not required but is very useful to key pre-defined values that need to be communicated from JavaScript to Java in sync.
The last step within Java is to register the Module; this happens in the createNativeModules of our app’s package. If a module is not registered it will not be available from JavaScript
Create MobikulToastPackage Java class inside the module package name com.reactlibrary
Now Add this module in your Project in MainApplicaiton.java class
Use MobikulToast in our project javascript class
References-
https://facebook.github.io/react-native/docs/native-modules-android
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
Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.
Stathis Plakidas
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.