@siteed/expo-audio-stream 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteed/expo-audio-stream",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "stream audio crossplatform",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",
@@ -1,5 +1,5 @@
1
1
  import { ConfigPlugin } from "@expo/config-plugins";
2
- declare const _default: ConfigPlugin<{
3
- microphonePermission: string | false | undefined;
2
+ declare const withRecordingPermission: ConfigPlugin<{
3
+ microphonePermission: string;
4
4
  }>;
5
- export default _default;
5
+ export default withRecordingPermission;
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("@expo/config-plugins");
4
- const pkg = require("../../package.json");
5
4
  const MICROPHONE_USAGE = "Allow $(PRODUCT_NAME) to access your microphone";
6
5
  const withRecordingPermission = (config, { microphonePermission }) => {
7
- config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
8
- NSMicrophoneUsageDescription: MICROPHONE_USAGE,
9
- })(config, {
10
- NSMicrophoneUsageDescription: microphonePermission,
6
+ config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
7
+ config.modResults["NSMicrophoneUsageDescription"] = MICROPHONE_USAGE;
8
+ return config;
11
9
  });
12
- return config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
13
- microphonePermission !== false && "android.permission.RECORD_AUDIO",
14
- "android.permission.MODIFY_AUDIO_SETTINGS",
15
- ].filter(Boolean));
10
+ config = (0, config_plugins_1.withAndroidManifest)(config, (config) => {
11
+ const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(config.modResults);
12
+ config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, "android.permission.RECORD_AUDIO", MICROPHONE_USAGE);
13
+ return config;
14
+ });
15
+ return config;
16
16
  };
17
- exports.default = (0, config_plugins_1.createRunOncePlugin)(withRecordingPermission, pkg.name, pkg.version);
17
+ exports.default = withRecordingPermission;
@@ -1,33 +1,34 @@
1
1
  import {
2
2
  AndroidConfig,
3
3
  ConfigPlugin,
4
- IOSConfig,
5
- createRunOncePlugin,
4
+ withAndroidManifest,
5
+ withInfoPlist,
6
6
  } from "@expo/config-plugins";
7
7
 
8
- const pkg = require("../../package.json");
9
8
  const MICROPHONE_USAGE = "Allow $(PRODUCT_NAME) to access your microphone";
10
9
 
11
10
  const withRecordingPermission: ConfigPlugin<{
12
- microphonePermission: string | false | undefined;
11
+ microphonePermission: string;
13
12
  }> = (config, { microphonePermission }) => {
14
- IOSConfig.Permissions.createPermissionsPlugin({
15
- NSMicrophoneUsageDescription: MICROPHONE_USAGE,
16
- })(config, {
17
- NSMicrophoneUsageDescription: microphonePermission,
13
+ config = withInfoPlist(config, (config) => {
14
+ config.modResults["NSMicrophoneUsageDescription"] = MICROPHONE_USAGE;
15
+ return config;
18
16
  });
19
17
 
20
- return AndroidConfig.Permissions.withPermissions(
21
- config,
22
- [
23
- microphonePermission !== false && "android.permission.RECORD_AUDIO",
24
- "android.permission.MODIFY_AUDIO_SETTINGS",
25
- ].filter(Boolean) as string[],
26
- );
18
+ config = withAndroidManifest(config, (config) => {
19
+ const mainApplication = AndroidConfig.Manifest.getMainApplicationOrThrow(
20
+ config.modResults,
21
+ );
22
+
23
+ AndroidConfig.Manifest.addMetaDataItemToMainApplication(
24
+ mainApplication,
25
+ "android.permission.RECORD_AUDIO",
26
+ MICROPHONE_USAGE,
27
+ );
28
+ return config;
29
+ });
30
+
31
+ return config;
27
32
  };
28
33
 
29
- export default createRunOncePlugin(
30
- withRecordingPermission,
31
- pkg.name,
32
- pkg.version,
33
- );
34
+ export default withRecordingPermission;