docs: add vision-camera-plugin-builder sections in Creating Frame Processor Plugins (#1123)

- add automatic setup section to "Creating Frame Processor Plugins (iOS|Android)" with
vision-camera-plugin-builder CLI
This commit is contained in:
Mateusz Mędrek 2022-07-07 14:06:31 +02:00 committed by GitHub
parent 724af31807
commit 2a73c09be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -14,6 +14,34 @@ In this guide we will create a custom QR Code Scanner Plugin which can be used f
Android Frame Processor Plugins can be written in either **Java**, **Kotlin** or **C++ (JNI)**.
### Mostly automatic setup
1. Run [Vision Camera Plugin Builder CLI](https://github.com/mateusz1913/vision-camera-plugin-builder)
```sh
npx vision-camera-plugin-builder android
```
:::info
The CLI will ask you for the path to project's Android Manifest file, name of the plugin (e.g. `QRCodeFrameProcessor`), name of the exposed method (e.g. `scanQRCodes`) and language you want to use for plugin development (Java or Kotlin).
For reference see the [CLI's docs](https://github.com/mateusz1913/vision-camera-plugin-builder#%EF%B8%8F-options).
:::
2. Register the package in MainApplication.java
```java {6}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
...
packages.add(new QRCodeFrameProcessorPluginPackage()); // <- add
return packages;
}
```
### Manual setup
<Tabs
defaultValue="java"
values={[

View File

@ -14,6 +14,20 @@ In this guide we will create a custom QR Code Scanner Plugin which can be used f
iOS Frame Processor Plugins can be written in either **Objective-C** or **Swift**.
### Automatic setup
Run [Vision Camera Plugin Builder CLI](https://github.com/mateusz1913/vision-camera-plugin-builder),
```sh
npx vision-camera-plugin-builder ios
```
:::info
The CLI will ask you for the path to project's .xcodeproj file, name of the plugin (e.g. `QRCodeFrameProcessor`), name of the exposed method (e.g. `scanQRCodes`) and language you want to use for plugin development (Objective-C, Objective-C++ or Swift).
For reference see the [CLI's docs](https://github.com/mateusz1913/vision-camera-plugin-builder#%EF%B8%8F-options).
:::
### Manual setup
<Tabs
defaultValue="objc"