@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 +1 -1
- package/plugin/build/index.d.ts +3 -3
- package/plugin/build/index.js +10 -10
- package/plugin/src/index.ts +21 -20
package/package.json
CHANGED
package/plugin/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
-
declare const
|
|
3
|
-
microphonePermission: string
|
|
2
|
+
declare const withRecordingPermission: ConfigPlugin<{
|
|
3
|
+
microphonePermission: string;
|
|
4
4
|
}>;
|
|
5
|
-
export default
|
|
5
|
+
export default withRecordingPermission;
|
package/plugin/build/index.js
CHANGED
|
@@ -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.
|
|
8
|
-
NSMicrophoneUsageDescription
|
|
9
|
-
|
|
10
|
-
NSMicrophoneUsageDescription: microphonePermission,
|
|
6
|
+
config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
7
|
+
config.modResults["NSMicrophoneUsageDescription"] = MICROPHONE_USAGE;
|
|
8
|
+
return config;
|
|
11
9
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"android.permission.
|
|
15
|
-
|
|
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 =
|
|
17
|
+
exports.default = withRecordingPermission;
|
package/plugin/src/index.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AndroidConfig,
|
|
3
3
|
ConfigPlugin,
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
11
|
+
microphonePermission: string;
|
|
13
12
|
}> = (config, { microphonePermission }) => {
|
|
14
|
-
|
|
15
|
-
NSMicrophoneUsageDescription
|
|
16
|
-
|
|
17
|
-
NSMicrophoneUsageDescription: microphonePermission,
|
|
13
|
+
config = withInfoPlist(config, (config) => {
|
|
14
|
+
config.modResults["NSMicrophoneUsageDescription"] = MICROPHONE_USAGE;
|
|
15
|
+
return config;
|
|
18
16
|
});
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
30
|
-
withRecordingPermission,
|
|
31
|
-
pkg.name,
|
|
32
|
-
pkg.version,
|
|
33
|
-
);
|
|
34
|
+
export default withRecordingPermission;
|