Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Turn on Bluetooth button doesn't work #78

Closed
smcmurtry opened this issue Jun 19, 2020 · 13 comments
Closed

Turn on Bluetooth button doesn't work #78

smcmurtry opened this issue Jun 19, 2020 · 13 comments
Labels
bluetooth high priority upstream pieces that should either be pulled from upstream or fixed here and pulled back

Comments

@smcmurtry
Copy link
Collaborator

If bluetooth is turned off globally, the button should take you to the correct screen to turn it on.

@ChrisDryden
Copy link
Contributor

I was doing some research into the linking to the bluetooth page and came across some projects that opened up the right links for bluetooth:

This is the line that needs to be changed: https://github.com/cds-snc/covid-shield-mobile/blob/cb3f1a75492e368eb390d2c4b61574c9757d19a5/src/screens/home/views/BluetoothDisabledView.tsx#L11

Heres an example for IOS: https://github.com/rjblopes/react-native-device-settings/pull/8/files

Heres an example for Android: https://github.com/LuoZihYuan/Synesthesia-Experiment/blob/6149fff0f2e2d7c54bd6dad89bbc725f0e9bf6fa/Runtime/SERoboArm.js#L36

I am testing this out now

@timarney
Copy link
Member

Nice, thanks so much for looking into this for us.

@timarney
Copy link
Member

Was looking at the use of App-prefs:root=Bluetooth

And not sure if it's still the case but it might get rejected.

https://developer.apple.com/forums/thread/100471

Guideline 2.5.1 - Performance - Software Requirements

Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.
 

Screen Shot 2020-06-20 at 8 04 41 PM

@timarney
Copy link
Member

CovidShield/mobile#125 (comment)

Found this note

These functions are disabled by default. You must not call them If your app need submit to App Store. As an alternative, you can show a tip to tell the user how to change the system setting.

https://github.com/c19354837/react-native-system-setting/blob/master/iOS.md#ios

Screen Shot 2020-06-20 at 8 19 39 PM

@ChrisDryden
Copy link
Contributor

It appears on iOS it will not be possible to open up the bluetooth settings, we will just have to have a link saying enable bluetooth.

@timarney
Copy link
Member

@smcmurtry

Via @Stephen-PM

We'll remove the button at least temporarily

@ChrisDryden
Copy link
Contributor

ChrisDryden commented Jun 21, 2020

The main issue apart from this which was referenced in the link earlier is that there is actually no check for if bluetooth is enabled anywhere in the codebase. The closest thing I could find was this module which appears to be compatible with iOS and allows you to perform the switch for android too.
https://github.com/solinor/react-native-bluetooth-status

@ChrisDryden
Copy link
Contributor

ChrisDryden commented Jun 21, 2020

My apologies, I am fairly new to objective c, I thought that this was a case switch for an not yet completed function but I now see this is being returned by the native exposure notification system.

I couldn't find an equivalent of that case in the android portion. It appears to me that this case switch can't distinguish the case where it's inactive and that the bluetooth is off.

@timarney
Copy link
Member

timarney commented Jun 21, 2020

No worries - we're all getting up to speed on the codebase :)

And yes sounds like that's the case.

Thanks again for your help.

@ChrisDryden
Copy link
Contributor

Added a PR with a potential solution to the bluetooth status check and the ability to change the bluetooth settings in app for android ^

Also attaching this issue from CovidShield here for reference: CovidShield/mobile#121

@henrytao-me
Copy link
Contributor

Ref #78

@timarney timarney added upstream pieces that should either be pulled from upstream or fixed here and pulled back high priority labels Jun 21, 2020
@smcmurtry
Copy link
Collaborator Author

We've removed the bluetooth button since it isn't actually possible to direct the user to the global bluetooth settings page on ios. Instead we have this screen now:

Screen Shot 2020-06-21 at 4 19 46 PM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bluetooth high priority upstream pieces that should either be pulled from upstream or fixed here and pulled back
Projects
None yet
Development

No branches or pull requests

4 participants