| 200 | } |
| 201 | |
| 202 | static async openAppSystemSettings() { |
| 203 | switch(Platform.OS) { |
| 204 | case 'ios': { |
| 205 | const settingsLink = 'app-settings:'; |
| 206 | const supported = await Linking.canOpenURL(settingsLink) |
| 207 | if (supported) await Linking.openURL(settingsLink); |
| 208 | break; |
| 209 | } |
| 210 | case 'android': |
| 211 | await SystemSettingNative.openAppSystemSettings() |
| 212 | break; |
| 213 | default: |
| 214 | throw new Error('unknown platform') |
| 215 | break; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | static async addBluetoothListener(callback) { |
| 220 | return await SystemSetting._addListener(false, 'bluetooth', 'EventBluetoothChange', callback) |