is there a way to import / include / require native java android or native objective-c / swift in react native apps?
I mean lets say android's libraries like android volley or android libPhoneNumber?
Only if there is react-native Module wrapper for each of those libraries implemented you can use those from the java script side. See more on how to implement Native Modules at https://facebook.github.io/react-native/docs/native-modules-android.html#content https://facebook.github.io/react-native/docs/native-modules-ios.html#content
Yes, there are two ways:
If the libraries/modules were already wrapped and exposed be React-Native, then just use it (learn how to do it in the link below).
If the libraries/modules were NOT wrapped and exposed, then it has to be wrapped and exposed manually first.
Android's Toast library as an example:
Used as already wrapped and exposed library/module: https://facebook.github.io/react-native/docs/toastandroid.html#content
Used after manual wrapping and exposing: https://facebook.github.io/react-native/docs/native-modules-android.html#content
You need to create a bridge. Follow this tutorial about how to use any iOS or Android native library quickly:
React Native: The Quickest Way to Use Any Native iOS or Android Library
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.