From a6d986fdb757b570cf4348f26e8b750206a565d7 Mon Sep 17 00:00:00 2001 From: ts-candide <145444954+ts-candide@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:00:43 +0000 Subject: [PATCH] feat: allow customization of Local Network message for Expo projects on iOS (#585) --- example-app/app.json | 3 ++- src/plugin/withStripeTerminal.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example-app/app.json b/example-app/app.json index 569b9969..835a3374 100644 --- a/example-app/app.json +++ b/example-app/app.json @@ -17,7 +17,8 @@ "bluetoothBackgroundMode": true, "locationWhenInUsePermission": "Location access is required in order to accept payments.", "bluetoothPeripheralPermission": "Bluetooth access is required in order to connect to supported bluetooth card readers.", - "bluetoothAlwaysUsagePermission": "This app uses Bluetooth to connect to supported card readers." + "bluetoothAlwaysUsagePermission": "This app uses Bluetooth to connect to supported card readers.", + "localNetworkUsagePermission": "This app uses the local WiFi network to connect to supported card readers." } ] ], diff --git a/src/plugin/withStripeTerminal.ts b/src/plugin/withStripeTerminal.ts index a0efc352..f5f20798 100644 --- a/src/plugin/withStripeTerminal.ts +++ b/src/plugin/withStripeTerminal.ts @@ -26,6 +26,7 @@ type StripeTerminalPluginProps = { locationWhenInUsePermission?: string; bluetoothPeripheralPermission?: string; bluetoothAlwaysUsagePermission?: string; + localNetworkUsagePermission?: string; }; const withStripeTerminal: ConfigPlugin = ( @@ -139,6 +140,10 @@ const withStripeTerminalIos: ConfigPlugin = ( config.modResults.NSBluetoothAlwaysUsageDescription = props.bluetoothAlwaysUsagePermission || 'This app uses Bluetooth to connect to supported card readers.'; + + config.modResults.NSLocalNetworkUsageDescription = + props.localNetworkUsagePermission || + 'This app uses the local WiFi network to connect to supported card readers.'; return config; }); };