Skip to content

Commit

Permalink
Revert "feat(Expo): Added Expo config plugin (react-native-voice#317)"
Browse files Browse the repository at this point in the history
This reverts commit 057e06d.
  • Loading branch information
Winoto, Basuki authored and Winoto, Basuki committed Oct 25, 2024
1 parent 32aab8b commit ab435bd
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 363 deletions.
42 changes: 1 addition & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
```sh
yarn add @react-native-voice/voice

# or
# or

npm i @react-native-voice/voice --save
```
Expand All @@ -27,7 +27,6 @@ npx pod-install
- [Linking](#linking)
- [Manually Link Android](#manually-link-android)
- [Manually Link iOS](#manually-link-ios)
- [Prebuild Plugin](#prebuild-plugin)
- [Usage](#usage)
- [Example](#example)
- [API](#api)
Expand Down Expand Up @@ -94,45 +93,6 @@ public class MainActivity extends Activity implements ReactApplication {

- Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag the static library, lib.Voice.a, from the Libraries/Voice.xcodeproj/Products folder to Link Binary With Libraries

<h2 align="center">Prebuild Plugin</h2>

> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`:

```json
{
"expo": {
"plugins": ["@react-native-voice/voice"]
}
}
```

Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.

### Props

The plugin provides props for extra customization. Every time you change the props or plugins, you'll need to rebuild (and `prebuild`) the native app. If no extra properties are added, defaults will be used.

- `speechRecognition` (_string | false_): Sets the message for the `NSSpeechRecognitionUsageDescription` key in the `Info.plist` message. When undefined, a default permission message will be used. When `false`, the permission will be skipped.
- `microphone` (_string | false_): Sets the message for the `NSMicrophoneUsageDescription` key in the `Info.plist`. When undefined, a default permission message will be used. When `false`, the `android.permission.RECORD_AUDIO` will not be added to the `AndroidManifest.xml` and the iOS permission will be skipped.

### Example

```json
{
"plugins": [
[
"@react-native-voice/voice",
{
"microphonePermission": "CUSTOM: Allow $(PRODUCT_NAME) to access the microphone",
"speechRecognitionPermission": "CUSTOM: Allow $(PRODUCT_NAME) to securely recognize user speech"
}
]
]
}
```

<h2 align="center">Usage</h2>

<p align="center"><a href="https://github.com/react-native-voice/voice/blob/master/example/src/VoiceTest.tsx">Full example for Android and iOS.</a></p>
Expand Down
1 change: 0 additions & 1 deletion app.plugin.js

This file was deleted.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"devDependencies": {
"@react-native-community/eslint-config": "^0.0.7",
"@semantic-release/git": "^9.0.0",
"@tsconfig/node10": "^1.0.7",
"@types/invariant": "^2.2.31",
"@types/react-native": "0.61.17",
"eslint": "^6.8.0",
Expand Down Expand Up @@ -41,15 +40,12 @@
"start": "yarn --cwd example start",
"ios": "yarn --cwd example ios",
"android": "yarn --cwd example android",
"prepare": "yarn build && yarn build:plugin",
"prepare": "yarn build",
"build": "tsc",
"dev-sync": "cp -r ./dist example/node_modules/@react-native-voice/voice",
"type-check": "tsc -noEmit",
"build:plugin": "tsc --build plugin",
"lint:plugin": "eslint plugin/src/*"
"dev-sync": "cp -r ./dist example/node_modules/@react-native-voice/voice"
},
"dependencies": {
"invariant": "^2.2.4",
"@expo/config-plugins": "^2.0.0"
"invariant": "^2.2.4"
}
}
74 changes: 0 additions & 74 deletions plugin/src/withVoice.ts

This file was deleted.

11 changes: 0 additions & 11 deletions plugin/tsconfig.json

This file was deleted.

Loading

0 comments on commit ab435bd

Please sign in to comment.