| Start |
|---|
Create your Native Module (IOS) Introductionfrom http://facebook.github.io/react-native/docs/native-modules-ios.html (opens new window) Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions. A Native Module is simply an Objective-C Class that implements the ExampleIn your Xcode project create a new file and select Cocoa Touch Class, in the creation wizard choose a name for your Class (e.g. NativeModule), make it a Subclass of: This will create two files You will need to import In your
Finally, in your JavaScript you can call your method as it follows: |
Read Article
https://develop.horje.com/learn/1434/reference