# Installation Guide

## React Native OkayCam Plus

### Requirements

#### Android

* Min Sdk Version >= 26

#### iOS

* iOS 15+
* Swift 5

***

### Getting Started

```
$ yarn add react-native-okaycamplus
```

### Android

1. Navigate to the `android` Folder
2. Add following snippet in the root `build.gradle` file:

```
allprojects {
    repositories {
        maven {
            url "https://innov8tif-okaycam.firebaseapp.com"
            content {
                includeGroup "com.innov8tif.iad"
            }
        }
    }
}

```

3. Sync gradle

### iOS

1. Navigate to the `ios` folder
2. Add the following code to Podfile

```
platform :ios, '15.0'
use_frameworks!

post_install do |installer|
    installer.pods_project.targets.each do |target|
      	target.build_configurations.each do |config|
        	config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        	config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
      	end
		if target.name == "CryptoSwift"
        	puts "Enable module stability for CryptoSwift"
        	target.build_configurations.each do |config|
            	config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        	end
      	end
    end
end
```

3. Run command `pod install`
4. Add camera permission

### Android Issue

Duplicate class org.hamcrest.xxx

If you encounter the errors above, you may exclude junit module.

```
configurations { compile.exclude group: "junit", module: "junit" }
```

### iOS Issue

> Undefined symbol: \_*swift\_FORCE\_LOAD*$\_swiftUniformTypeIdentifiers

> Undefined symbol: \_*swift\_FORCE\_LOAD*$\_swiftCoreMIDI

If you encounter the errors above, you may create a new swift file called **Void.swift** without adding **bridging header**.

<figure><img src="https://1723857616-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoP1M8bTYgFFHHnAdjjta%2Fuploads%2FXcFq0j4rLgt1mqskkWCw%2Fimage.png?alt=media&#x26;token=f39a208f-3752-4850-9869-eaa6d2759ad5" alt=""><figcaption></figcaption></figure>

### License

Apply licenses for Android and iOS SDKs

```
const license = Platform.select({
    android: "",
    ios: ""
})
```
