Compare commits

...
Author SHA1 Message Date
Evan Bacon 0aaf6d07d6 fix deps 2021-11-23 15:42:17 -07:00
Evan Bacon 81857f8938 Added CI updates 2021-11-23 15:37:03 -07:00
Evan Bacon dc86073608 Bump versions 2021-11-23 15:15:08 -07:00
Evan Bacon 8dd7006769 Bump detox 2021-11-23 15:13:33 -07:00
Evan Bacon f62f4f59ba wip 2021-11-23 14:51:51 -07:00
Evan Bacon 63257cfa20 bump 2021-11-23 14:40:53 -07:00
Evan Bacon b6b9ce09c1 ios running 2021-11-23 14:36:17 -07:00
Evan Bacon 4c3cd1413b Fixed fs errors 2021-11-23 14:22:55 -07:00
Evan Bacon 5833dd9ea3 Bump notices for Expo 43 2021-11-23 14:10:05 -07:00
Evan Bacon 49448a8974 Merge pull request #20 from expo/@evanbacon/expo/[email protected]
Bump to Expo SDK 43
2021-11-23 14:02:33 -07:00
Evan Bacon 780c27319d Updated to SDK 43 and iOS 15 2021-10-22 15:43:00 -06:00
Evan Bacon e3acf06968 expo upgrade 2021-10-22 15:02:50 -06:00
Evan Bacon 7cce4a464e Bump packages 2021-10-22 14:58:36 -06:00
Evan Bacon d214964657 Merge pull request #19 from expo/@evanbacon/react-native-webrtc/disable-bitcode
[react-native-webrtc] Add step to disable bitcode for release iOS builds
2021-10-22 14:40:07 -06:00
Evan Bacon 3cd73f32a2 Add step to disable bitcode for release iOS builds 2021-10-22 14:34:22 -06:00
Evan Bacon f96f9bdc73 Update README.md 2021-10-19 19:11:04 -06:00
Evan Bacon f0d957456e Publish @config-plugins/[email protected]
Publish @config-plugins/[email protected]
2021-08-04 14:34:44 -06:00
Evan Bacon c2a78787e8 Merge pull request #14 from expo/@evanbacon/react-native-dynamic-app-icon/updated-packages
Bump image utils and config plugins
2021-08-04 14:32:22 -06:00
Evan Bacon bd5710b412 Bump image utils and config plugins 2021-08-04 14:30:24 -06:00
Evan Bacon f15f5fc7ed Publish @config-plugins/[email protected] 2021-07-21 00:00:23 -06:00
Evan Bacon 2546094be7 Merge pull request #13 from expo/@evanbacon/ble-plx/added-peripheral-permission
[react-native-ble-plx] Added peripheral permission
2021-07-20 23:59:03 -06:00
Evan Bacon 38458d2c9f Added peripheral permission 2021-07-20 23:56:56 -06:00
Evan Bacon 619b2fb02c Merge pull request #10 from expo/@evanbacon/react-native-quick-actions/create
Created react-native-quick-action plugin
2021-07-12 23:40:15 -06:00
69 changed files with 1876 additions and 1087 deletions

No files matched your search

+8 -7
View File
@@ -12,7 +12,12 @@ web-build/
# macOS
.DS_Store
# @generated expo-cli sync-2138f1e3e130677ea10ea873f6d498e3890e677b
/artifacts
/ios
/android
# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
# The following patterns were generated by expo-cli
# OSX
@@ -69,10 +74,6 @@ buck-out/
# Expo
.expo/
web-build/
dist/
# @end expo-cli
/artifacts
/ios
/android
# @end expo-cli
+6
View File
@@ -0,0 +1,6 @@
module.exports = ({ config }) => {
if (!config.extra) config.extra = {};
// Expose CI env variables to the app
config.extra.CI = process.env.CI;
return config;
};
+1 -1
View File
@@ -1,6 +1,6 @@
const iosName = "app";
const emulator = "Pixel_3a_API_30";
const simulator = "iPhone 11 Pro";
const simulator = "iPhone 13 Pro";
const derivedDataPath = "ios/build";
const sdk = "iphonesimulator";
+2 -2
View File
@@ -47,10 +47,10 @@ export function createCapture({
locale,
});
const clearAsync = () => {
const clearAsync = async () => {
// Clear old screen shots
const outputDir = getOutputDir(projectRoot, locale);
fs.rmdirSync(outputDir, { recursive: true });
await fs.promises.rmdir(outputDir, { recursive: true }).catch(() => null);
};
return {
+10 -1
View File
@@ -1,7 +1,16 @@
import "react-native-gesture-handler";
import { registerRootComponent } from "expo";
import App from "./App";
import Constants from "expo-constants";
let App;
// Only use the Detox test in CI
if ((Constants.manifest.extra || {}).CI) {
App = require("./src/detox/App").default;
} else {
App = require("./App").default;
}
// import App from "./App";
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

+5 -2
View File
@@ -1,3 +1,6 @@
const { createMetroConfiguration } = require('expo-yarn-workspaces');
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("@expo/metro-config");
module.exports = createMetroConfiguration(__dirname);
const config = getDefaultConfig(__dirname);
module.exports = config;
+32 -62
View File
@@ -18,84 +18,54 @@
"clean:android": "pushd android && ./gradlew clean && popd",
"start": "expo start --dev-client",
"ios": "expo run:ios",
"android": "expo run:android",
"postinstall": "expo-yarn-workspaces postinstall"
},
"expo-yarn-workspaces": {
"symlinks": [
"detox",
"expo-constants",
"expo-camera",
"expo-updates",
"react-native-callkeep",
"react-native-webrtc",
"react-native-quick-actions"
]
},
"react-native-unimodules": {
"android": {
"modulesPaths": [
"../../../../",
"../../../../packages"
],
"configuration": "api",
"target": "react-native"
},
"ios": {
"modules_paths": [
"../../../",
"../../../packages"
],
"flags": {
"inhibit_warnings": false
}
}
"android": "expo run:android"
},
"dependencies": {
"@config-plugins/android-jsc-intl": "^0.0.0",
"@config-plugins/detox": "^0.0.0",
"@config-plugins/ios-stickers": "^0.0.2",
"@config-plugins/react-native-ble-plx": "^0.0.0",
"@config-plugins/react-native-callkeep": "^0.0.0",
"@config-plugins/react-native-dynamic-app-icon": "^0.0.0",
"@config-plugins/react-native-google-cast": "^0.0.0",
"@config-plugins/react-native-webrtc": "^0.0.0",
"@config-plugins/react-native-quick-actions": "^0.0.0",
"expo": "~41.0.0",
"expo-localization": "~10.1.0",
"expo-splash-screen": "~0.10.2",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.5.4",
"@config-plugins/android-jsc-intl": "^0.0.1",
"@config-plugins/detox": "^1.0.0",
"@config-plugins/ios-stickers": "^0.0.4",
"@config-plugins/react-native-ble-plx": "^0.0.2",
"@config-plugins/react-native-callkeep": "^0.0.1",
"@config-plugins/react-native-dynamic-app-icon": "^0.0.2",
"@config-plugins/react-native-google-cast": "^0.0.1",
"@config-plugins/react-native-quick-actions": "^0.0.1",
"@config-plugins/react-native-webrtc": "^1.0.1",
"expo": "^43.0.0",
"expo-localization": "~11.0.0",
"expo-splash-screen": "~0.13.5",
"expo-status-bar": "~1.1.0",
"expo-updates": "~0.10.13",
"i18n-js": "^3.8.0",
"luxon": "^1.27.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-ble-plx": "^2.0.2",
"react-native-quick-actions": "^0.3.13",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-callkeep": "^4.2.0",
"react-native-dynamic-app-icon": "^1.1.0",
"react-native-gesture-handler": "~1.10.2",
"react-native-google-cast": "^4.1.2",
"react-native-reanimated": "~2.1.0",
"react-native-screens": "~3.0.0",
"react-native-unimodules": "~0.13.3",
"react-native-web": "~0.13.12",
"react-native-webrtc": "^1.89.3"
"react-native-quick-actions": "^0.3.13",
"react-native-reanimated": "~2.2.0",
"react-native-safe-area-context": "3.3.2",
"react-native-web": "0.17.1",
"react-native-webrtc": "^1.89.3",
"react-native-screens": "~3.8.0"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"@expo/xcpretty": "^3.1.4",
"@babel/core": "^7.12.9",
"@babel/plugin-syntax-jsx": "^7.16.0",
"@expo/metro-config": "~0.3.0",
"@expo/xcpretty": "^4.1.0",
"@types/jest": "^26.0.19",
"@types/luxon": "^1.27.1",
"@types/react": "~16.9.35",
"@types/react-native": "~0.63.2",
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"babel-jest": "~25.2.6",
"detox": "^18.6.2",
"detox": "^19.1.0",
"jest": "^26.5.0",
"jest-circus": "^26.5.2",
"ts-jest": "^26.4.4",
"typescript": "~4.0.0"
"typescript": "~4.3.5"
},
"private": true
}
+1 -1
View File
@@ -6,7 +6,7 @@ Adding this plugin lets you use `Intl` in your Android app, without using Hermes
## Expo installation
> Tested against Expo SDK 42
> Tested against Expo SDK 43
This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/android-jsc-intl",
"version": "0.0.0",
"version": "0.0.1",
"description": "Config plugin for android-jsc-intl package",
"main": "build/withAndroidJscIntl.js",
"types": "build/withAndroidJscIntl.d.ts",
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
+12 -1
View File
@@ -2,9 +2,20 @@
Config plugin to auto configure Detox when the native code is generated (`expo prebuild`).
## Versioning
Ensure you use versions that work together!
| `expo` | `detox` | `@config-plugins/detox` |
| ------ | ------- | ----------------------- |
| 43.0.0 | 19.1.0 | 1.0.0 |
| 40.0.0 | 18.6.2 | 0.0.0 |
Most notably, the minimum required Kotlin version changed from `1.3.50` in SDK 40 to `1.4.21` in SDK 43. Failure to use the correct versioning could result in Android build errors like `Execution failed for task ':react-native-screens:compileDebugKotlin'.` or `Execution failed for task ':expo:compileDebugKotlin'.`.
### Add the package to your npm dependencies
> Tested against Expo SDK 41
> Tested against Expo SDK 43
```
yarn add detox @config-plugins/detox
+2 -2
View File
@@ -19,8 +19,8 @@ const withDetox = (config, { skipProguard, subdomains } = {}) => {
// 4.
[
withKotlinGradle_1.default,
// Minimum version of Kotlin required to work with expo packages in SDK 40
"1.3.50",
// Minimum version of Kotlin required to work with expo packages in SDK 43
"1.4.21",
],
// 5.
withDetoxTestClass_1.withDetoxTestClass,
+1
View File
@@ -12,6 +12,7 @@ const kotlinClassPath = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersio
*/
const withKotlinGradle = (config, version) => {
return config_plugins_1.withProjectBuildGradle(config, (config) => {
console.log(`[config-plugins/detox] Setting Kotlin version to: ${version}. This could lead to Android build issues.`);
if (config.modResults.language === "groovy") {
config.modResults.contents = setKotlinVersion(config.modResults.contents, version);
config.modResults.contents = setKotlinClassPath(config.modResults.contents);
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/detox",
"version": "0.0.0",
"version": "1.0.0",
"description": "Config plugin to auto configure detox on prebuild",
"main": "build/withDetox.js",
"types": "build/withDetox.d.ts",
@@ -25,7 +25,7 @@
"e2e"
],
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
+2 -2
View File
@@ -36,8 +36,8 @@ const withDetox: ConfigPlugin<{
// 4.
[
withKotlinGradle,
// Minimum version of Kotlin required to work with expo packages in SDK 40
"1.3.50",
// Minimum version of Kotlin required to work with expo packages in SDK 43
"1.4.21",
],
// 5.
withDetoxTestClass,
+3
View File
@@ -13,6 +13,9 @@ const kotlinClassPath =
*/
const withKotlinGradle: ConfigPlugin<string> = (config, version) => {
return withProjectBuildGradle(config, (config) => {
console.log(
`[config-plugins/detox] Setting Kotlin version to: ${version}. This could lead to Android build issues.`
);
if (config.modResults.language === "groovy") {
config.modResults.contents = setKotlinVersion(
config.modResults.contents,
+1 -1
View File
@@ -4,7 +4,7 @@ Config plugin to auto configure iOS iMessage stickers
## Install
> Tested against Expo SDK 41
> Tested against Expo SDK 43
```
yarn add @config-plugins/ios-stickers
@@ -44,7 +44,7 @@ function createSticker({ stickerpackPath, name, imageBuffer, extension, accessib
name: stickerName,
};
}
exports.withStickerAssets = (config, { stickers, icon, size }) => {
const withStickerAssets = (config, { stickers, icon, size }) => {
// Default to using the app icon
if (!icon) {
icon = (config.ios || {}).icon || config.icon;
@@ -56,7 +56,9 @@ exports.withStickerAssets = (config, { stickers, icon, size }) => {
const stickerRootPath = path_1.default.join(config.modRequest.platformProjectRoot, stickerPackName);
const stickersAssetsPath = path_1.default.join(stickerRootPath, STICKERS_ROOT_PATH);
// Delete all assets...
await fs_1.default.promises.rmdir(stickersAssetsPath, { recursive: true });
await fs_1.default.promises
.rmdir(stickersAssetsPath, { recursive: true })
.catch(() => null);
const stickersRootContentsJsonPath = path_1.default.join(stickersAssetsPath, "Contents.json");
fs_1.default.mkdirSync(stickersAssetsPath, {
recursive: true,
@@ -118,3 +120,4 @@ exports.withStickerAssets = (config, { stickers, icon, size }) => {
},
]);
};
exports.withStickerAssets = withStickerAssets;
@@ -28,7 +28,7 @@ const plist_1 = __importDefault(require("@expo/plist"));
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const withStickerXcodeTarget_1 = require("./withStickerXcodeTarget");
exports.withStickersPlist = (config, { name }) => {
const withStickersPlist = (config, { name }) => {
return config_plugins_1.withDangerousMod(config, [
"ios",
async (config) => {
@@ -58,3 +58,4 @@ exports.withStickersPlist = (config, { name }) => {
},
]);
};
exports.withStickersPlist = withStickersPlist;
@@ -8,7 +8,7 @@ function getProjectStickersName(name) {
return `${name} Stickers`;
}
exports.getProjectStickersName = getProjectStickersName;
exports.withStickerXcodeTarget = (config) => {
const withStickerXcodeTarget = (config) => {
return config_plugins_1.withXcodeProject(config, (config) => {
const stickerPackName = getProjectStickersName(config.modRequest.projectName);
xcodeSticker_1.addStickersTarget(config.modResults, stickerPackName, config.ios.bundleIdentifier, stickerPackName);
@@ -22,3 +22,4 @@ exports.withStickerXcodeTarget = (config) => {
return config;
});
};
exports.withStickerXcodeTarget = withStickerXcodeTarget;
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/ios-stickers",
"version": "0.0.2",
"version": "0.0.4",
"description": "Config plugin to auto configure iOS iMessage stickers",
"main": "build/withStickerPack.js",
"types": "build/withStickerPack.d.ts",
@@ -22,8 +22,8 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3",
"@expo/image-utils": "^0.3.14",
"@expo/config-plugins": "^4.0.7",
"@expo/image-utils": "^0.3.17",
"xcode": "^3.0.1"
},
"devDependencies": {
@@ -93,7 +93,9 @@ export const withStickerAssets: ConfigPlugin<{
const stickersAssetsPath = path.join(stickerRootPath, STICKERS_ROOT_PATH);
// Delete all assets...
await fs.promises.rmdir(stickersAssetsPath, { recursive: true });
await fs.promises
.rmdir(stickersAssetsPath, { recursive: true })
.catch(() => null);
const stickersRootContentsJsonPath = path.join(
stickersAssetsPath,
+4 -2
View File
@@ -4,7 +4,7 @@ Config plugin to auto configure `react-native-ble-plx` when the native code is g
## Expo installation
> Tested against Expo SDK 41
> Tested against Expo SDK 43
> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
> First install the package with yarn, npm, or [`expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install).
@@ -32,6 +32,7 @@ The plugin provides props for extra customization. Every time you change the pro
- `isBackgroundEnabled` (_boolean_): Enable background BLE support on Android. Adds `<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>` to the `AndroidManifest.xml`. Default `false`.
- `modes` (_string[]_): Adds iOS `UIBackgroundModes` to the `Info.plist`. Options are: `peripheral`, and `central`. Defaults to undefined.
- `bluetoothAlwaysPermission` (_string | false_): Sets the iOS `NSBluetoothAlwaysUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission. Defaults to `Allow $(PRODUCT_NAME) to connect to bluetooth devices`.
- `bluetoothPeripheralPermission` (_string | false_): Sets the iOS `NSBluetoothPeripheralUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission. Defaults to `Allow $(PRODUCT_NAME) to connect to bluetooth devices`.
#### Example
@@ -44,7 +45,8 @@ The plugin provides props for extra customization. Every time you change the pro
{
"isBackgroundEnabled": true,
"modes": ["peripheral", "central"],
"bluetoothAlwaysPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices"
"bluetoothAlwaysPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices",
"bluetoothPeripheralPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices"
}
]
]
+1
View File
@@ -5,5 +5,6 @@ declare const _default: ConfigPlugin<void | {
isBackgroundEnabled?: boolean | undefined;
modes?: BackgroundMode[] | undefined;
bluetoothAlwaysPermission?: string | false | undefined;
bluetoothPeripheralPermission?: string | false | undefined;
}>;
export default _default;
+3 -3
View File
@@ -6,17 +6,17 @@ const config_plugins_1 = require("@expo/config-plugins");
const withBLEAndroidManifest_1 = require("./withBLEAndroidManifest");
const withBLEBackgroundModes_1 = require("./withBLEBackgroundModes");
Object.defineProperty(exports, "BackgroundMode", { enumerable: true, get: function () { return withBLEBackgroundModes_1.BackgroundMode; } });
const withBluetoothAlwaysPermission_1 = require("./withBluetoothAlwaysPermission");
const withBluetoothPermissions_1 = require("./withBluetoothPermissions");
const pkg = { name: "react-native-ble-plx", version: "UNVERSIONED" }; //require('react-native-ble-plx/package.json')
/**
* Apply BLE configuration for Expo SDK 41 projects.
* Apply BLE configuration for Expo SDK 42 projects.
*/
const withBLE = (config, props = {}) => {
var _a;
const _props = props || {};
const isBackgroundEnabled = (_a = _props.isBackgroundEnabled) !== null && _a !== void 0 ? _a : false;
// iOS
config = withBluetoothAlwaysPermission_1.withBluetoothAlwaysPermission(config, _props);
config = withBluetoothPermissions_1.withBluetoothPermissions(config, _props);
config = withBLEBackgroundModes_1.withBLEBackgroundModes(config, _props.modes || []);
// Android
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
@@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.addBLEHardwareFeatureToManifest = exports.addFineControlPermissionToManifest = exports.withBLEAndroidManifest = void 0;
const config_plugins_1 = require("@expo/config-plugins");
exports.withBLEAndroidManifest = (config, { isBackgroundEnabled }) => {
const withBLEAndroidManifest = (config, { isBackgroundEnabled }) => {
return config_plugins_1.withAndroidManifest(config, (config) => {
config.modResults = addFineControlPermissionToManifest(config.modResults);
if (isBackgroundEnabled) {
@@ -12,6 +12,7 @@ exports.withBLEAndroidManifest = (config, { isBackgroundEnabled }) => {
return config;
});
};
exports.withBLEAndroidManifest = withBLEAndroidManifest;
function addFineControlPermissionToManifest(androidManifest) {
var _a;
// Add `<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION"/>` to the AndroidManifest.xml
@@ -19,7 +19,7 @@ const peripheralKey = 'bluetooth-peripheral';
/**
* Append `UIBackgroundModes` to the `Info.plist`.
*/
exports.withBLEBackgroundModes = (c, modes) => {
const withBLEBackgroundModes = (c, modes) => {
return config_plugins_1.withInfoPlist(c, config => {
if (!Array.isArray(config.modResults.UIBackgroundModes)) {
config.modResults.UIBackgroundModes = [];
@@ -37,3 +37,4 @@ exports.withBLEBackgroundModes = (c, modes) => {
return config;
});
};
exports.withBLEBackgroundModes = withBLEBackgroundModes;
@@ -1,4 +0,0 @@
import { ConfigPlugin } from '@expo/config-plugins';
export declare const withBluetoothAlwaysPermission: ConfigPlugin<{
bluetoothAlwaysPermission?: string | false;
}>;
@@ -1,16 +0,0 @@
"use strict";
/* eslint-disable flowtype/no-types-missing-file-annotation */
Object.defineProperty(exports, "__esModule", { value: true });
exports.withBluetoothAlwaysPermission = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const BLUETOOTH_ALWAYS = 'Allow $(PRODUCT_NAME) to connect to bluetooth devices';
exports.withBluetoothAlwaysPermission = (c, { bluetoothAlwaysPermission } = {}) => {
if (bluetoothAlwaysPermission === false) {
return c;
}
return config_plugins_1.withInfoPlist(c, config => {
config.modResults.NSBluetoothAlwaysUsageDescription =
bluetoothAlwaysPermission || config.modResults.NSBluetoothAlwaysUsageDescription || BLUETOOTH_ALWAYS;
return config;
});
};
@@ -0,0 +1,5 @@
import { ConfigPlugin } from "@expo/config-plugins";
export declare const withBluetoothPermissions: ConfigPlugin<{
bluetoothAlwaysPermission?: string | false;
bluetoothPeripheralPermission?: string | false;
}>;
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withBluetoothPermissions = void 0;
/* eslint-disable flowtype/no-types-missing-file-annotation */
const config_plugins_1 = require("@expo/config-plugins");
const BLUETOOTH_ALWAYS = "Allow $(PRODUCT_NAME) to connect to bluetooth devices";
const BLUETOOTH_PERIPHERAL_USAGE = "Allow $(PRODUCT_NAME) to connect to bluetooth devices";
const withBluetoothPermissions = (c, { bluetoothAlwaysPermission, bluetoothPeripheralPermission } = {}) => {
return config_plugins_1.withInfoPlist(c, (config) => {
if (bluetoothAlwaysPermission !== false) {
config.modResults.NSBluetoothAlwaysUsageDescription =
bluetoothAlwaysPermission ||
config.modResults.NSBluetoothAlwaysUsageDescription ||
BLUETOOTH_ALWAYS;
}
if (bluetoothPeripheralPermission !== false) {
config.modResults.NSBluetoothPeripheralUsageDescription =
bluetoothPeripheralPermission ||
config.modResults.NSBluetoothPeripheralUsageDescription ||
BLUETOOTH_PERIPHERAL_USAGE;
}
return config;
});
};
exports.withBluetoothPermissions = withBluetoothPermissions;
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-ble-plx",
"version": "0.0.0",
"version": "0.0.2",
"description": "Config plugin to auto configure react-native-ble-plx on prebuild",
"main": "build/withBLE.js",
"types": "build/withBLE.d.ts",
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
+4 -3
View File
@@ -11,23 +11,24 @@ import {
BackgroundMode,
withBLEBackgroundModes,
} from "./withBLEBackgroundModes";
import { withBluetoothAlwaysPermission } from "./withBluetoothAlwaysPermission";
import { withBluetoothPermissions } from "./withBluetoothPermissions";
const pkg = { name: "react-native-ble-plx", version: "UNVERSIONED" }; //require('react-native-ble-plx/package.json')
/**
* Apply BLE configuration for Expo SDK 41 projects.
* Apply BLE configuration for Expo SDK 42 projects.
*/
const withBLE: ConfigPlugin<{
isBackgroundEnabled?: boolean;
modes?: BackgroundMode[];
bluetoothAlwaysPermission?: string | false;
bluetoothPeripheralPermission?: string | false;
} | void> = (config, props = {}) => {
const _props = props || {};
const isBackgroundEnabled = _props.isBackgroundEnabled ?? false;
// iOS
config = withBluetoothAlwaysPermission(config, _props);
config = withBluetoothPermissions(config, _props);
config = withBLEBackgroundModes(config, _props.modes || []);
// Android
@@ -1,18 +0,0 @@
/* eslint-disable flowtype/no-types-missing-file-annotation */
import { ConfigPlugin, withInfoPlist } from '@expo/config-plugins'
const BLUETOOTH_ALWAYS = 'Allow $(PRODUCT_NAME) to connect to bluetooth devices'
export const withBluetoothAlwaysPermission: ConfigPlugin<{
bluetoothAlwaysPermission?: string | false
}> = (c, { bluetoothAlwaysPermission } = {}) => {
if (bluetoothAlwaysPermission === false) {
return c
}
return withInfoPlist(c, config => {
config.modResults.NSBluetoothAlwaysUsageDescription =
bluetoothAlwaysPermission || config.modResults.NSBluetoothAlwaysUsageDescription || BLUETOOTH_ALWAYS
return config
})
}
@@ -0,0 +1,28 @@
/* eslint-disable flowtype/no-types-missing-file-annotation */
import { ConfigPlugin, withInfoPlist } from "@expo/config-plugins";
const BLUETOOTH_ALWAYS =
"Allow $(PRODUCT_NAME) to connect to bluetooth devices";
const BLUETOOTH_PERIPHERAL_USAGE =
"Allow $(PRODUCT_NAME) to connect to bluetooth devices";
export const withBluetoothPermissions: ConfigPlugin<{
bluetoothAlwaysPermission?: string | false;
bluetoothPeripheralPermission?: string | false;
}> = (c, { bluetoothAlwaysPermission, bluetoothPeripheralPermission } = {}) => {
return withInfoPlist(c, (config) => {
if (bluetoothAlwaysPermission !== false) {
config.modResults.NSBluetoothAlwaysUsageDescription =
bluetoothAlwaysPermission ||
config.modResults.NSBluetoothAlwaysUsageDescription ||
BLUETOOTH_ALWAYS;
}
if (bluetoothPeripheralPermission !== false) {
config.modResults.NSBluetoothPeripheralUsageDescription =
bluetoothPeripheralPermission ||
config.modResults.NSBluetoothPeripheralUsageDescription ||
BLUETOOTH_PERIPHERAL_USAGE;
}
return config;
});
};
+1 -1
View File
@@ -4,7 +4,7 @@ Config plugin to auto configure react-native-callkeep when the native code is ge
### Add the package to your npm dependencies
> Tested against Expo SDK 41
> Tested against Expo SDK 43
```
yarn add react-native-callkeep @config-plugins/react-native-callkeep
+2 -1
View File
@@ -92,7 +92,7 @@ const withCallkeep = (config) => {
config = withAndroidManifestService(config);
return config;
};
exports.withXcodeLinkBinaryWithLibraries = (config, { library, status }) => {
const withXcodeLinkBinaryWithLibraries = (config, { library, status }) => {
return config_plugins_1.withXcodeProject(config, (config) => {
const options = status === "optional" ? { settings: { ATTRIBUTES: ["Weak"] } } : {};
const target = config_plugins_1.IOSConfig.XcodeUtils.getApplicationNativeTarget({
@@ -106,4 +106,5 @@ exports.withXcodeLinkBinaryWithLibraries = (config, { library, status }) => {
return config;
});
};
exports.withXcodeLinkBinaryWithLibraries = withXcodeLinkBinaryWithLibraries;
exports.default = withCallkeep;
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-callkeep",
"version": "0.0.0",
"version": "0.0.1",
"description": "Config plugin to auto configure callkeep on prebuild",
"main": "build/withCallkeep.js",
"types": "build/withCallkeep.d.ts",
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
@@ -4,7 +4,7 @@ Config plugin to auto configure `react-native-dynamic-app-icon`
## Install
> Tested against Expo SDK 41
> Tested against Expo SDK 43
```
yarn add react-native-dynamic-app-icon @config-plugins/react-native-dynamic-app-icon
@@ -12,7 +12,6 @@ yarn add react-native-dynamic-app-icon @config-plugins/react-native-dynamic-app-
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`. Then rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
## Example
In your app.json `plugins` array:
@@ -50,5 +49,4 @@ In list format, icons are named after the item index (`'0', '1', '2'`), they can
This isn't tied to `react-native-dynamic-app-icon` in any way, so any method of swapping icons works.
<!-- Android support: https://github.com/myinnos/AppIconNameChanger -->
+7 -1
View File
@@ -47,6 +47,9 @@ const withIconXcodeProject = (config, { icons }) => {
const _group = project.hash.project.objects["PBXGroup"][id];
return _group.name === group.name;
});
if (!project.hash.project.objects["PBXVariantGroup"]) {
project.hash.project.objects["PBXVariantGroup"] = {};
}
const variantGroupId = Object.keys(project.hash.project.objects["PBXVariantGroup"]).find((id) => {
const _group = project.hash.project.objects["PBXVariantGroup"][id];
return _group.name === group.name;
@@ -133,7 +136,9 @@ const withIconImages = (config, props) => {
async function createIconsAsync(config, { icons }) {
const iosRoot = path_1.default.join(config.modRequest.platformProjectRoot, config.modRequest.projectName);
// Delete all existing assets
await fs_1.default.promises.rmdir(path_1.default.join(iosRoot, folderName), { recursive: true });
await fs_1.default.promises
.rmdir(path_1.default.join(iosRoot, folderName), { recursive: true })
.catch(() => null);
// Ensure directory exists
await fs_1.default.promises.mkdir(path_1.default.join(iosRoot, folderName), { recursive: true });
// Generate new assets
@@ -167,3 +172,4 @@ async function iterateIconsAsync({ icons }, callback) {
}
}
exports.default = withDynamicIcon;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,yDAO8B;AAC9B,mDAAuD;AACvD,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,IAAI,GAAG,EAAE,CAAC;AAChB,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAQtB,SAAS,aAAa,CAAC,MAAgB;IACrC,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EAA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,GAAG,QAAQ,CAAC;YAEzD,mBAAmB;YACnB,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,mBAAmB,GAAG;gBAC3C,iBAAiB,EAAE,CAAC,SAAS,CAAC;aAC/B,CAAC;QACJ,CAAC;QAED,0CAA0C;QAC1C,YAAY,CAAC,eAAe,CAAC,CAAC;QAC9B,YAAY,CAAC,oBAAoB,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,cAAc,GAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;IAC5D,OAAO,iCAAgB,CAAC,MAAM,EAAE;QAC9B,KAAK;QACL,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACtC,OAAO,MAAM,CAAC;QAChLine truncated
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-dynamic-app-icon",
"version": "0.0.0",
"version": "0.0.2",
"description": "Config plugin to auto configure react-native-dynamic-app-icon",
"main": "build/index.js",
"types": "build/index.d.ts",
@@ -22,8 +22,8 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3",
"@expo/image-utils": "^0.3.14",
"@expo/config-plugins": "^4.0.7",
"@expo/image-utils": "^0.3.17",
"xcode": "^3.0.1"
},
"devDependencies": {
@@ -77,6 +77,9 @@ const withIconXcodeProject: ConfigPlugin<Props> = (config, { icons }) => {
return _group.name === group.name;
}
);
if (!project.hash.project.objects["PBXVariantGroup"]) {
project.hash.project.objects["PBXVariantGroup"] = {};
}
const variantGroupId = Object.keys(
project.hash.project.objects["PBXVariantGroup"]
).find((id) => {
@@ -198,7 +201,9 @@ async function createIconsAsync(
);
// Delete all existing assets
await fs.promises.rmdir(path.join(iosRoot, folderName), { recursive: true });
await fs.promises
.rmdir(path.join(iosRoot, folderName), { recursive: true })
.catch(() => null);
// Ensure directory exists
await fs.promises.mkdir(path.join(iosRoot, folderName), { recursive: true });
// Generate new assets
@@ -1,7 +1,8 @@
{
"extends": "expo-module-scripts/tsconfig.plugin",
"compilerOptions": {
"outDir": "./build"
"outDir": "./build",
"sourceMap": true
},
"include": ["./src"],
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
+1 -1
View File
@@ -4,7 +4,7 @@ Config plugin to auto configure react-native-google-cast when the native code is
## Expo installation
> Tested against Expo SDK 41
> Tested against Expo SDK 43
> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
> First install the package with yarn, npm, or [`expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install).
@@ -1,12 +1,9 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.withAndroidGoogleCast = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
const fs_1 = __importDefault(require("fs"));
const codeMod_1 = require("@expo/config-plugins/build/android/codeMod");
const { addMetaDataItemToMainApplication, getMainApplicationOrThrow } = config_plugins_1.AndroidConfig.Manifest;
const META_PROVIDER_CLASS = "com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME";
const META_RECEIVER_APP_ID = "com.reactnative.googlecast.RECEIVER_APPLICATION_ID";
@@ -65,24 +62,19 @@ const withAppBuildGradleImport = (config, { version }) => {
});
};
const withMainActivityLazyLoading = (config) => {
return config_plugins_1.withDangerousMod(config, [
"android",
async (config) => {
const file = await config_plugins_1.AndroidConfig.Paths.getMainActivityAsync(config.modRequest.projectRoot);
if (file.language === "java") {
let src = config_plugins_1.AndroidConfig.UserInterfaceStyle.addJavaImports(file.contents, ["com.google.android.gms.cast.framework.CastContext"], true);
src = addGoogleCastLazyLoadingImport(src).contents;
await fs_1.default.promises.writeFile(file.path, src, "utf-8");
}
else {
throw new Error("react-native-google-cast config plugin does not support kotlin MainActivity yet.");
}
return config;
},
]);
return config_plugins_1.withMainActivity(config, async (config) => {
let src = codeMod_1.addImports(config.modResults.contents, ["com.google.android.gms.cast.framework.CastContext"], config.modResults.language === "java");
if (config.modResults.language === "java") {
config.modResults.contents = addGoogleCastLazyLoadingImport(src).contents;
}
else {
throw new Error("react-native-google-cast config plugin does not support kotlin MainActivity yet.");
}
return config;
});
};
// castFrameworkVersion
exports.withAndroidGoogleCast = (config, props) => {
const withAndroidGoogleCast = (config, props) => {
var _a, _b;
config = withAndroidManifestCast(config, {
receiverAppId: props.receiverAppId,
@@ -98,6 +90,7 @@ exports.withAndroidGoogleCast = (config, props) => {
});
return config;
};
exports.withAndroidGoogleCast = withAndroidGoogleCast;
function addGoogleCastLazyLoadingImport(src) {
const newSrc = [];
newSrc.push(" CastContext.getSharedInstance(this);");
+3 -2
View File
@@ -8,6 +8,8 @@ const withGoogleCast = (config, _props) => {
// TODO: Are the Android and iOS receiverAppId values the same?
config = withIosGoogleCast_1.withIosGoogleCast(config, {
receiverAppId: props.iosReceiverAppId,
// disableDiscoveryAutostart?: boolean;
// startDiscoveryAfterFirstTapOnCastButton?: boolean;
});
config = withAndroidGoogleCast_1.withAndroidGoogleCast(config, {
receiverAppId: props.androidReceiverAppId,
@@ -15,5 +17,4 @@ const withGoogleCast = (config, _props) => {
});
return config;
};
const pkg = { name: "react-native-google-cast", version: "UNVERSIONED" };
exports.default = config_plugins_1.createRunOncePlugin(withGoogleCast, pkg.name, pkg.version);
exports.default = config_plugins_1.createRunOncePlugin(withGoogleCast, "react-native-google-cast");
@@ -70,18 +70,21 @@ const withIosAppDelegateLoaded = (config, props) => {
return config;
});
};
exports.withIosGoogleCast = (config, props) => {
const withIosGoogleCast = (config, props) => {
config = withIosWifiEntitlements(config);
config = withIosLocalNetworkPermissions(config, {
receiverAppId: props.receiverAppId,
});
config = withIosAppDelegateLoaded(config, {
receiverAppId: props.receiverAppId,
// disableDiscoveryAutostart?: boolean;
// startDiscoveryAfterFirstTapOnCastButton?: boolean;
});
// TODO
// config = withIosGuestMode(config)
return config;
};
exports.withIosGoogleCast = withIosGoogleCast;
// From expo-cli RNMaps setup
const MATCH_INIT = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])/g;
function addGoogleCastAppDelegateDidFinishLaunchingWithOptions(src, { receiverAppId = null, disableDiscoveryAutostart = false, startDiscoveryAfterFirstTapOnCastButton = true, } = {}) {
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-google-cast",
"version": "0.0.0",
"version": "0.0.1",
"description": "Config plugin to auto configure Google Cast on prebuild",
"main": "build/withGoogleCast.js",
"types": "build/withGoogleCast.d.ts",
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
@@ -3,13 +3,14 @@ import {
ConfigPlugin,
withAndroidManifest,
withAppBuildGradle,
withDangerousMod,
withMainActivity,
withProjectBuildGradle,
} from "@expo/config-plugins";
import {
mergeContents,
removeContents,
} from "@expo/config-plugins/build/utils/generateCode";
import { addImports } from "@expo/config-plugins/build/android/codeMod";
import fs from "fs";
const { addMetaDataItemToMainApplication, getMainApplicationOrThrow } =
@@ -119,29 +120,21 @@ const withAppBuildGradleImport: ConfigPlugin<{ version?: string }> = (
};
const withMainActivityLazyLoading: ConfigPlugin = (config) => {
return withDangerousMod(config, [
"android",
async (config) => {
const file = await AndroidConfig.Paths.getMainActivityAsync(
config.modRequest.projectRoot
return withMainActivity(config, async (config) => {
let src = addImports(
config.modResults.contents,
["com.google.android.gms.cast.framework.CastContext"],
config.modResults.language === "java"
);
if (config.modResults.language === "java") {
config.modResults.contents = addGoogleCastLazyLoadingImport(src).contents;
} else {
throw new Error(
"react-native-google-cast config plugin does not support kotlin MainActivity yet."
);
if (file.language === "java") {
let src = AndroidConfig.UserInterfaceStyle.addJavaImports(
file.contents,
["com.google.android.gms.cast.framework.CastContext"],
true
);
src = addGoogleCastLazyLoadingImport(src).contents;
await fs.promises.writeFile(file.path, src, "utf-8");
} else {
throw new Error(
"react-native-google-cast config plugin does not support kotlin MainActivity yet."
);
}
return config;
},
]);
}
return config;
});
};
// castFrameworkVersion
@@ -36,6 +36,4 @@ const withGoogleCast: ConfigPlugin<{
return config;
};
const pkg = { name: "react-native-google-cast", version: "UNVERSIONED" };
export default createRunOncePlugin(withGoogleCast, pkg.name, pkg.version);
export default createRunOncePlugin(withGoogleCast, "react-native-google-cast");
@@ -6,7 +6,7 @@ Expo Config Plugin to auto configure [`react-native-quick-actions`](https://www.
## Expo installation
> Tested against Expo SDK 42
> Tested against Expo SDK 43
This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-quick-actions",
"version": "0.0.0",
"version": "0.0.1",
"description": "Config plugin for react-native-quick-actions package",
"main": "build/withReactNativeQuickActions.js",
"types": "build/withReactNativeQuickActions.d.ts",
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
+12 -2
View File
@@ -2,9 +2,19 @@
Config plugin to auto configure `react-native-webrtc` when the native code is generated (`expo prebuild`). [Upstream PR](https://github.com/react-native-webrtc/react-native-webrtc/pull/1013).
## Versioning
Ensure you use versions that work together!
| `expo` | `react-native-webrtc` | `@config-plugins/react-native-webrtc` |
| ------ | --------------------- | ------------------------------------- |
| 43.0.0 | 1.92.2 | 1.0.0 |
> Expo SDK 42 uses `[email protected]` which doesn't work with `react-native-webrtc`, specifically iOS production builds fail. Meaning this package is only supported for Expo SDK +43.
## Expo installation
> Tested against Expo SDK 41
> Tested against Expo SDK 43
> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
> First install the package with yarn, npm, or [`expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install).
@@ -48,7 +58,7 @@ export default {
};
```
This plugin will also disable desugaring in the Android `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false`
This plugin will also disable desugaring in the Android `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false`, and disable iOS Bitcode for "Release" builds (required).
## Manual Setup
@@ -0,0 +1,2 @@
import { ConfigPlugin } from "@expo/config-plugins";
export declare const withBitcodeDisabled: ConfigPlugin;
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withBitcodeDisabled = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const withBitcodeDisabled = (config) => {
return config_plugins_1.withXcodeProject(config, (config) => {
// @ts-ignore
if (config.ios.bitcode === true || config.ios.bitcode === "Debug") {
config_plugins_1.WarningAggregator.addWarningIOS("ios.bitcode", 'react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for "Release" builds, targeting physical iOS devices.');
}
// WebRTC requires Bitcode be disabled for
// production iOS builds that target devices, e.g. not simulators.
config.modResults.addBuildProperty("ENABLE_BITCODE", "NO", "Release");
return config;
});
};
exports.withBitcodeDisabled = withBitcodeDisabled;
+2 -1
View File
@@ -6,7 +6,7 @@ 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).
*/
exports.withDesugaring = (config, isDisabled) => {
const withDesugaring = (config, isDisabled) => {
const desugaringKey = "android.enableDexingArtifactTransform.desugaring";
return config_plugins_1.withGradleProperties(config, (config) => {
config.modResults = config.modResults.filter((item) => {
@@ -23,3 +23,4 @@ exports.withDesugaring = (config, isDisabled) => {
return config;
});
};
exports.withDesugaring = withDesugaring;
+2 -1
View File
@@ -4,7 +4,7 @@ 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";
exports.withPermissions = (config, props) => {
const withPermissions = (config, props) => {
return config_plugins_1.withInfoPlist(config, (config) => {
const { cameraPermission, microphonePermission } = props || {};
config.modResults.NSCameraUsageDescription =
@@ -18,3 +18,4 @@ exports.withPermissions = (config, props) => {
return config;
});
};
exports.withPermissions = withPermissions;
+2
View File
@@ -1,6 +1,7 @@
"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");
@@ -8,6 +9,7 @@ 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",
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@config-plugins/react-native-webrtc",
"version": "0.0.0",
"description": "Config plugin to auto configure react-native-webrtc on prebuild",
"version": "1.0.1",
"description": "Config plugin to setup react-native-webrtc on prebuild",
"main": "build/withWebRTC.js",
"types": "build/withWebRTC.d.ts",
"sideEffects": false,
@@ -26,7 +26,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.7"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
@@ -0,0 +1,22 @@
import {
ConfigPlugin,
WarningAggregator,
withXcodeProject,
} from "@expo/config-plugins";
export const withBitcodeDisabled: ConfigPlugin = (config) => {
return withXcodeProject(config, (config) => {
// @ts-ignore
if (config.ios.bitcode === true || config.ios.bitcode === "Debug") {
WarningAggregator.addWarningIOS(
"ios.bitcode",
'react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for "Release" builds, targeting physical iOS devices.'
);
}
// WebRTC requires Bitcode be disabled for
// production iOS builds that target devices, e.g. not simulators.
config.modResults.addBuildProperty("ENABLE_BITCODE", "NO", "Release");
return config;
});
};
@@ -3,6 +3,7 @@ import {
ConfigPlugin,
createRunOncePlugin,
} from "@expo/config-plugins";
import { withBitcodeDisabled } from "./withBitcodeDisabled";
import { withDesugaring } from "./withDesugaring";
import { IOSPermissionsProps, withPermissions } from "./withPermissions";
@@ -17,6 +18,7 @@ const withWebRTC: ConfigPlugin<IOSPermissionsProps | void> = (
// iOS
config = withPermissions(config, _props);
config = withBitcodeDisabled(config);
// Android
config = AndroidConfig.Permissions.withPermissions(config, [
+1 -1
View File
@@ -24,7 +24,7 @@
"preset": "expo-module-scripts"
},
"dependencies": {
"@expo/config-plugins": "^3.0.3"
"@expo/config-plugins": "^4.0.4"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
+1562 -867
View File
File diff suppressed because it is too large. Load diff