Native Module in React-Native
To get a great grip on how wo build one, read these blogs.
- https://github.com/peggyrayzis/react-native-create-bridge
- https://shift.infinite.red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995
- http://moduscreate.com/swift-modules-for-react-native/
- http://browniefed.com/blog/react-native-how-to-bridge-an-objective-c-view-component/
- http://brentvatne.ca/react-native-view-component-1/
- http://brentvatne.ca/react-native-view-component-2/
- http://moduscreate.com/leverage-existing-ios-views-react-native-app/
- https://github.com/GantMan/RNImagePreview/blob/master/ios/JTSImagePreview.m
- https://github.com/shoutem/react-native-shopify
- https://www.packtpub.com/books/content/using-native-sdks-and-libraries-react-native
- https://github.com/yrezgui/meowth-ios/blob/master/src/AudioRecorder.m
Now, well, it's not that tough :P
react-native init ProjectName
cd ios
create-bridge (if you are using react-native-create-bridge and already installed it.)
pod init
Add the name in the pod file:
target 'TalkTravelSinchTests' do
inherit! :search_paths
# Pods for testing
pod 'SinchRTC'
end
pod install
Manually add the 2 files using xcode. (file -> add files -> select files open ProjectName.xcodeproj, close it after adding the files. open ProjectName.xcworkspace Run the project. (It should be in the NativeModules.SinchRTC)