Editing Native Code
If you just open one of the native files in the modules directly, you'll probably see a lot of red squiggles. This is because the native code is written in Kotlin and Swift, and they depend on other native modules.
To edit these modules with the full git context of the project, you'll need to open the example app in Xcode and/or Android Studio, then open the native files from there.
This will allow the IDE to understand the full context of the project, which in turn enables proper syntax highlighting, autocompletion, and linting.
iOS
- If you haven't already, run the
prebuild
script to create the ios example appcd apps/ExampleApp
yarn prebuild - Open Xcode and open the
./apps/ExampleApp/ios
directory. - In the project navigator, find the module you want to edit. It will be
under
Pods
>Development Pods
>react-native-mlkit-[module name]
. - Open the
.swift
file you want to edit, and make your changes there.
Android
- If you haven't already, run the
prebuild
script to create the android example appcd apps/ExampleApp
yarn prebuild - Open Android Studio and open the
./apps/ExampleApp/android
directory. - In the project navigator, find the module you want to edit.
- In the 'Project' view, it will be
under
exampleApp
>[android] [infinitered-react-native-mlkit-[module name]]
- In the
Android
view, it will be underinfinitered-react-native-mlkit-[module name]
- In the 'Project' view, it will be
under
- Browse to the
.kt
file you want to edit, and make your changes there.