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

iOS 13 breaking changes #78

Open
NN01010101 opened this issue Oct 12, 2019 · 8 comments
Open

iOS 13 breaking changes #78

NN01010101 opened this issue Oct 12, 2019 · 8 comments

Comments

@NN01010101
Copy link

Looks like in iOS 13 Apple made some changes to the CBCentralManager.
The issue happens at line 209 inside of RNNordicDfu.m
retrievePeripheralsWithIdentifiers returns 0 so the DFU process quits with error "Could not find device with deviceAddress"

As pointed out here it's now mandatory to wait before the state CBCentralManager becomes poweredOn before calling theretrievePeripheralsWithIdentifiers

As a workaround, I put [NSThread sleepForTimeInterval: 2]; right after CBCentralManager * centralManager = getCentralManager(); and it works.

@Looveh
Copy link
Contributor

Looveh commented Oct 14, 2019

@NN01010101 Great! If this is a problem that many others might face, feel free to create a PR with your fixes. If you could get it to work with something more general than a sleep for an arbitrary number of seconds I think it would be better suited for other's projects and setups as well.

@NN01010101
Copy link
Author

@Looveh the issue is definitely there for iOS 13. Unfortunately, I'm not that versatile in Objective C, so I won't be able to write anything better than a delay, but it looks like guys could fix it here

@LackoDan
Copy link

We're also having this issue. Unfortunately, the delay does not help in our case -- it blocks the app.
I tried forcing the library to use iOSDFULibrary 4.5.1 (in which the Bugfix for iOS 13 was merged), but that did not change anything.

@ThomasStubbe
Copy link

Same here. The sleep does makes the error to go away, but my app also just hangs...

@Looveh
Copy link
Contributor

Looveh commented Oct 17, 2019

For what it's worth I know we're successfully using the version 3.0.1 in our app without having to make any alterations for iOS 13. Not sure about what makes our setup successful.

@ThomasStubbe
Copy link

I've managed to work around the problem, by introducing two sleeps + updating the iOS-DFU-Library to 4.5.1... I've forked this lib: https://github.com/ThomasStubbe/react-native-nordic-dfu

dantetwc pushed a commit to dantetwc/react-native-nordic-dfu that referenced this issue Oct 21, 2019
@Jurpp
Copy link

Jurpp commented Aug 17, 2020

@ThomasStubbe We've been using your fork to work around the iOS13 issue. Android still works fine like it used to, but on iOS the first try always fails on [Error: X bytes were sent while X bytes were reported as received]. When trying a second time it always works. Do you have similar experiences?
Update: Increasing the second delay to two seconds seems to fix this.
Update: It seems our DFU bootloader was too slow for the latest iPhones, a workaround for slow bootloaders can be found in my fork of the ThomasStubbe fork.

@RRMoelker
Copy link

RRMoelker commented Oct 20, 2020

We've been running into the same iOS13 issue [Error: X bytes were sent while Y bytes were reported as received].

The fork from @Jurpp did not mesh well with other pods (some versions mismatch).

I created a recent fork with the same changes: https://github.com/DreamOnward/react-native-nordic-dfu

This fork solved the bytes sent issue for us.

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

No branches or pull requests

6 participants