This library contains the core Unimodule infrastructure and a collection of Unimodules and interfaces that are commonly depended on by other Unimodules. You will need to install this before using libraries from Foundation, like `expo-camera`, `expo-media-
npm install @unimodules/react-native-platformThis library contains the core Unimodule infrastructure and a collection of Unimodules and interfaces that are commonly depended on by other Unimodules.
You will need to install this before using libraries from Foundation, like expo-camera, expo-media-library, and others.
The easiest way to do this is to initialize a "custom" project with expo-cli. If you have an existing app, you can follow these steps instead.
This project requires that you use Cocoapods on iOS, to set iot up see this gist, or relevant parts of the this guide.
``bash`
npm install @unimodules/react-native-platform
- Go back to the ios directory and open your Podfile, make your Podfile look like this one.use_unimodules!(node_modules_path: '../../../node_modules')
- If you need to customize the path to node_modules, for example because you are using yarn workspaces, then you can pass in a param for this: pod install
- Run againAppDelegate.h
- Update your and AppDelegate.m according to this diff.
#### Add permission usage description keys to Info.plist
In order to submit your app to the App Store, you will need to eventually add these keys to your Info.plist. Even if you don't use the APIs described, you need to include the keys because code related to asking the permission will be bundled regardless, and Apple's static analysis tools will detect it and reject your app if the key isn't present. Including the key without using it has no impact to your users. Replace (YOUR APP NAME) with your app name below.
`xml`
- Add apply from: '../node_modules/@unimodules/react-native-platform/settings.gradle' and then useUnimodules.apply() to the top of android/settings.gradleuseUnimodules.apply(nodeModulesPath: "../../../node_modules")
- If you need to customize the path to node_modules, for example because you are using yarn workspaces, then you can pass in a param for this: apply from: '../../node_modules/@unimodules/react-native-platform/build.gradle'
- Add anywhere in android/app/build.gradleminSdkVersion
- Update in android/build.gradle to 21MainApplication.java
- Update your to according to this diff.
It's possible that you will not have to use any of the code provided by this package directly, it may be used only by other Unimodules that you install.
But it's likely that you will want to use something like FileSystem or Permissions, and to do that you can import the following modules like so:
`js`
import {
Asset,
Constants,
FileSystem,
Permissions,
} from '@unimodules/react-native-platform';
You can import them directly from the specific Unimodule packag if you like, but your linter may complain for import a transitive dependency.
`js``
import * as Permissions from 'expo-permissions';