Read More
Read now

React Native Native bridge

Save

React Native Native bridge :

React Native bridge is a way to communicate with the native code. With the help of the Native bridge concept, your .js code can call the native code.

We are going to create a native bridge for IOS :

First of all, open your ios project workspace. Then add a new file to your root project and choose the Objective-C type file. Just named that file that you want to name. In my case, I am used the “IOSNativeBridge”.

IOSNAtiveBridge.h :

After that, there is another file you have to create with the same name but it is .m file.

IOSNAtiveBridge.m :

Here iosNativeMethod is our native method name. and value1 and value2 are two parameters that we call from the js code.

Bridge.js (JavaScript code):

Now, from your JavaScript file you can call the method like this (after making sure to rebuild):

 

Reference:  https://reactnative.dev/docs/native-modules-ios/

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!

Deniel Kerr

Owner and Founder. Opencart

Talk to Sales
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home