Skip to content

Commit

Permalink
fix: ios BT permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodonisko committed Oct 23, 2024
1 parent aeb6bad commit 5d9f983
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
12 changes: 11 additions & 1 deletion suite-native/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if (isCI) {
}

const getPlugins = (): ExpoPlugins => {
const plugins = [
const plugins: ExpoPlugins = [
[
'expo-font',
{
Expand Down Expand Up @@ -134,6 +134,12 @@ const getPlugins = (): ExpoPlugins => {

if (process.env.EXPO_PUBLIC_BLUETOOTH_ENABLED) {
plugins.push(['react-native-ble-plx', {}]);
plugins.push([
'react-native-permissions',
{
iosPermissions: ['Bluetooth'],
},
]);
}

return [
Expand Down Expand Up @@ -222,6 +228,10 @@ export default ({ config }: ConfigContext): ExpoConfig => {
icon: appIconIos,
supportsTablet: true,
infoPlist: {
NSBluetoothAlwaysUsageDescription:
'$(PRODUCT_NAME) needs access to Bluetooth to connect to your Trezor device.',
NSBluetoothPeripheralUsageDescription:
'$(PRODUCT_NAME) needs access to Bluetooth to connect to your Trezor device.',
NSCameraUsageDescription:
'$(PRODUCT_NAME) needs access to your Camera to scan your XPUB.',
NSFaceIDUsageDescription:
Expand Down
2 changes: 1 addition & 1 deletion suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"react-native-gesture-handler": "2.18.1",
"react-native-keyboard-aware-scroll-view": "0.9.5",
"react-native-mmkv": "2.12.2",
"react-native-permissions": "^4.1.5",
"react-native-permissions": "^5.0.1",
"react-native-reanimated": "3.15.0",
"react-native-restart": "0.0.27",
"react-native-safe-area-context": "4.10.9",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/bluetooth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"react": "18.2.0",
"react-native": "0.75.2",
"react-native-ble-plx": "^3.2.1",
"react-native-permissions": "^4.1.5",
"react-native-permissions": "^5.0.1",
"react-native-restart": "0.0.27"
}
}
9 changes: 3 additions & 6 deletions suite-native/module-dev-utils/src/screens/DevUtilsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { logs, nativeBleManager } from '@trezor/transport-native-ble';

import { BluetoothToggle } from '../components/BluetoothToggle';
import { DevicePassphraseSwitch } from '../components/DevicePassphraseSwitch';
import { MessageSystemInfo } from '../components/MessageSystemInfo';
import { FeatureFlags } from '../components/FeatureFlags';
import { MessageSystemInfo } from '../components/MessageSystemInfo';
import { RenderingUtils } from '../components/RenderingUtils';
import { TestnetsToggle } from '../components/TestnetsToggle';

Expand Down Expand Up @@ -51,12 +51,9 @@ export const DevUtilsScreen = ({
<Text>
EXPO_PUBLIC_BLUETOOTH_ENABLED:{' '}
{process.env.EXPO_PUBLIC_BLUETOOTH_ENABLED} {'\n'}
EXPO_PUBLIC_ENVIRONMENT: {
process.env.EXPO_PUBLIC_ENVIRONMENT
}{' '}
{'\n'}
isBluetoothBuild: {isBluetoothBuild} {'\n'}
isBluetoothEnabled: {isBluetoothEnabled}
isBluetoothBuild: {String(isBluetoothBuild)} {'\n'}
isBluetoothEnabled: {String(isBluetoothEnabled)}
</Text>
{isBluetoothBuild && <BluetoothToggle />}
</>
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9673,7 +9673,7 @@ __metadata:
react-native-gesture-handler: "npm:2.18.1"
react-native-keyboard-aware-scroll-view: "npm:0.9.5"
react-native-mmkv: "npm:2.12.2"
react-native-permissions: "npm:^4.1.5"
react-native-permissions: "npm:^5.0.1"
react-native-reanimated: "npm:3.15.0"
react-native-restart: "npm:0.0.27"
react-native-safe-area-context: "npm:4.10.9"
Expand Down Expand Up @@ -9786,7 +9786,7 @@ __metadata:
react: "npm:18.2.0"
react-native: "npm:0.75.2"
react-native-ble-plx: "npm:^3.2.1"
react-native-permissions: "npm:^4.1.5"
react-native-permissions: "npm:^5.0.1"
react-native-restart: "npm:0.0.27"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -35897,17 +35897,17 @@ __metadata:
languageName: node
linkType: hard

"react-native-permissions@npm:^4.1.5":
version: 4.1.5
resolution: "react-native-permissions@npm:4.1.5"
"react-native-permissions@npm:^5.0.1":
version: 5.0.1
resolution: "react-native-permissions@npm:5.0.1"
peerDependencies:
react: ">=18.1.0"
react-native: ">=0.70.0"
react-native-windows: ">=0.70.0"
peerDependenciesMeta:
react-native-windows:
optional: true
checksum: 10/2b1eaa879e4b0c3455488c3dfa1d8b203bdbf2cd550b8ee5691d26e03c086d33f9bc495a70f8e1e85d0c16131374e11d12f7927168179e339f158eea9fb04830
checksum: 10/85352df23e1d91a09dfe4aa507e99d472d53c42590d71bb3d0efa5a187c6e17a4c3621e5392f7ebbeac084d91e29ac5319f8fe353c0b8c4f7d2404a5a58b581b
languageName: node
linkType: hard

Expand Down

0 comments on commit 5d9f983

Please sign in to comment.