Skip to content

Commit

Permalink
feat: allow customization of Local Network message for Expo projects …
Browse files Browse the repository at this point in the history
…on iOS (#585)
  • Loading branch information
ts-candide authored Jan 9, 2024
1 parent ceeb4ef commit a6d986f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion example-app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
]
],
Expand Down
5 changes: 5 additions & 0 deletions src/plugin/withStripeTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type StripeTerminalPluginProps = {
locationWhenInUsePermission?: string;
bluetoothPeripheralPermission?: string;
bluetoothAlwaysUsagePermission?: string;
localNetworkUsagePermission?: string;
};

const withStripeTerminal: ConfigPlugin<StripeTerminalPluginProps> = (
Expand Down Expand Up @@ -139,6 +140,10 @@ const withStripeTerminalIos: ConfigPlugin<StripeTerminalPluginProps> = (
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;
});
};
Expand Down

0 comments on commit a6d986f

Please sign in to comment.