Running the Example App on iOS
An example app is provided that demonstrates the correct use of the modules in a react-native app.
The iOS MLKit Libraries currently only support arm64
architectures, so they currently will not work on the iOS
simulator (which always runs in x86_64
).
This is a known issue with the MLKit Swift API, and we are
waiting either for a fix from Google, or for Apple to release a native arm64
simulator.
1. Clone the project
git clone git@github.com:infinitered/react-native-mlkit.git
2. Install dependencies
cd react-native-mlkit
yarn install
3. Build native modules
yarn build
5. Build and run the app
Via Terminal
- Launch the app using the
ios
script
cd apps/ExampleApp
yarn ios -d
Via XCode
-
From inside the app package, Run
expo prebuild
to create theandroid
andios
native project folderscd apps/ExampleApp
# creates both android and ios native project folders
yarn prebuild
# creates only the ios native project folder
yarn prebuild --platform ios -
Open
~/apps/ExampleApp/ios/ExampleApp.xcworkspace
in XCode -
Select the
ExampleApp
target, and select a Team on the "Signing & Capabilities" tab -
Select the hardware device you want to run the app on (MLKit is not supported in the simulator at this time)
-
Click the play button to build the app