Compare commits

...
10 changed files with 123 additions and 1 deletions

No files matched your search

@@ -1,3 +1,10 @@
### @config-plugins/react-native-webrtc [2.1.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
### Other chores
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
## @config-plugins/react-native-webrtc [2.1.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22) ## @config-plugins/react-native-webrtc [2.1.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
+2
View File
@@ -0,0 +1,2 @@
import { ConfigPlugin } from "@expo/config-plugins";
export declare const withBitcodeDisabled: ConfigPlugin;
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withBitcodeDisabled = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const withBitcodeDisabled = (config) => {
var _a, _b;
if (!config.ios) {
config.ios = {};
}
if (((_a = config.ios) === null || _a === void 0 ? void 0 : _a.bitcode) != null && ((_b = config.ios) === null || _b === void 0 ? void 0 : _b.bitcode) !== false) {
config_plugins_1.WarningAggregator.addWarningIOS("ios.bitcode", "react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for builds, targeting physical iOS devices.");
}
// WebRTC requires Bitcode be disabled for
// production AND development iOS builds that target devices, e.g. not simulators.
// SDK +44 property
config.ios.bitcode = false;
return config;
};
exports.withBitcodeDisabled = withBitcodeDisabled;
+6
View File
@@ -0,0 +1,6 @@
import { ConfigPlugin } from "@expo/config-plugins";
/**
* Set the `android.enableDexingArtifactTransform.desugaring` value in the static `gradle.properties` file.
* This is used to disable desugaring to fix weird Android bugs. [Learn more](https://github.com/jitsi/jitsi-meet/issues/7911#issuecomment-714323255).
*/
export declare const withDesugaring: ConfigPlugin<boolean>;
+26
View File
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withDesugaring = void 0;
const config_plugins_1 = require("@expo/config-plugins");
/**
* Set the `android.enableDexingArtifactTransform.desugaring` value in the static `gradle.properties` file.
* This is used to disable desugaring to fix weird Android bugs. [Learn more](https://github.com/jitsi/jitsi-meet/issues/7911#issuecomment-714323255).
*/
const withDesugaring = (config, isDisabled) => {
const desugaringKey = "android.enableDexingArtifactTransform.desugaring";
return config_plugins_1.withGradleProperties(config, (config) => {
config.modResults = config.modResults.filter((item) => {
if (item.type == "property" && item.key === desugaringKey) {
return false;
}
return true;
});
config.modResults.push({
type: "property",
key: desugaringKey,
value: String(!isDisabled),
});
return config;
});
};
exports.withDesugaring = withDesugaring;
+6
View File
@@ -0,0 +1,6 @@
import { ConfigPlugin } from "@expo/config-plugins";
export declare type IOSPermissionsProps = {
cameraPermission?: string;
microphonePermission?: string;
};
export declare const withPermissions: ConfigPlugin<IOSPermissionsProps | void>;
+21
View File
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withPermissions = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const CAMERA_USAGE = "Allow $(PRODUCT_NAME) to access your camera";
const MICROPHONE_USAGE = "Allow $(PRODUCT_NAME) to access your microphone";
const withPermissions = (config, props) => {
return config_plugins_1.withInfoPlist(config, (config) => {
const { cameraPermission, microphonePermission } = props || {};
config.modResults.NSCameraUsageDescription =
cameraPermission ||
config.modResults.NSCameraUsageDescription ||
CAMERA_USAGE;
config.modResults.NSMicrophoneUsageDescription =
microphonePermission ||
config.modResults.NSMicrophoneUsageDescription ||
MICROPHONE_USAGE;
return config;
});
};
exports.withPermissions = withPermissions;
+4
View File
@@ -0,0 +1,4 @@
import { ConfigPlugin } from "@expo/config-plugins";
import { IOSPermissionsProps } from "./withPermissions";
declare const _default: ConfigPlugin<void | IOSPermissionsProps>;
export default _default;
+31
View File
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("@expo/config-plugins");
const withBitcodeDisabled_1 = require("./withBitcodeDisabled");
const withDesugaring_1 = require("./withDesugaring");
const withPermissions_1 = require("./withPermissions");
const pkg = { name: "react-native-webrtc", version: "UNVERSIONED" }; //require("react-native-webrtc/package.json");
const withWebRTC = (config, props = {}) => {
const _props = props || {};
// iOS
config = withPermissions_1.withPermissions(config, _props);
config = withBitcodeDisabled_1.withBitcodeDisabled(config);
// Android
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
"android.permission.ACCESS_NETWORK_STATE",
"android.permission.BLUETOOTH",
"android.permission.CAMERA",
"android.permission.INTERNET",
"android.permission.MODIFY_AUDIO_SETTINGS",
"android.permission.RECORD_AUDIO",
"android.permission.SYSTEM_ALERT_WINDOW",
"android.permission.WAKE_LOCK",
]);
config = config_plugins_1.AndroidConfig.Version.withBuildScriptExtMinimumVersion(config, {
name: "minSdkVersion",
minVersion: 24,
});
config = withDesugaring_1.withDesugaring(config, true);
return config;
};
exports.default = config_plugins_1.createRunOncePlugin(withWebRTC, pkg.name, pkg.version);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@config-plugins/react-native-webrtc", "name": "@config-plugins/react-native-webrtc",
"version": "2.1.0", "version": "2.1.1",
"description": "Config plugin to setup react-native-webrtc on prebuild", "description": "Config plugin to setup react-native-webrtc on prebuild",
"main": "build/withWebRTC.js", "main": "build/withWebRTC.js",
"types": "build/withWebRTC.d.ts", "types": "build/withWebRTC.d.ts",