Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always connect to a peripheral before trying to communicate with it #337

Conversation

emixb
Copy link
Contributor

@emixb emixb commented May 17, 2019

Follow Apple's recommendation and always connect to a peripheral before trying to communicate with it. This fixes a state restoration issue where the app relaunched in background couldn't communicate with known peripheral. The problem was that the reported state of the restored peripheral was connected and RxBluetoothKit would skip connecting to it. As Apple documents it everywhere, we should connect to a peripheral in all cases. "Even though the device is already connected to the system, you must still connect it locally to your app to begin exploring and interacting with it"

…re trying to communicate with it. This fixes a state restoration issue where the app relaunched in background couldn't communicate with known peripheral. The problem was that the reported state of the restored peripheral was connected and RxBluetoothKit would skip connecting to it. As Apple documents it everywhere, we should connect to a peripheral in all cases. "Even though the device is already connected to the system, you must still connect it locally to your app to begin exploring and interacting with it"
@CLAassistant
Copy link

CLAassistant commented May 17, 2019

CLA assistant check
All committers have signed the CLA.

@emixb emixb changed the title Follow Apple's recommendation and always connect to a peripheral befo… Always connect to a peripheral before trying to communicate with it May 17, 2019
@minixT
Copy link
Collaborator

minixT commented May 17, 2019

Hi @emixb!

Thank you for your PR. Can you update tests in the project? One test does not pass after your changes.

@minixT minixT assigned minixT and unassigned minixT May 17, 2019
@minixT minixT self-requested a review May 17, 2019 13:01
Copy link
Collaborator

@minixT minixT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One test does not pass after these changes. Please update project tests.

@emixb
Copy link
Contributor Author

emixb commented May 21, 2019

One test does not pass after these changes. Please update project tests.

Hi @minixT, I updated the tests. Thanks!

@minixT minixT merged commit 80f8b5e into Polidea:master May 31, 2019
@emixb emixb deleted the ejarnea/always-connect-to-retrieved-peripherals-first branch March 13, 2020 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants