davidgyoung / backgroundadvertiser Goto Github PK
View Code? Open in Web Editor NEWBare bones iOS app to demonstrate how BLE service advertising works in backgrounded apps.
License: Apache License 2.0
Bare bones iOS app to demonstrate how BLE service advertising works in backgrounded apps.
License: Apache License 2.0
Hi David, thanks for this app and the accompanying article (http://www.davidgyoungtech.com/2020/05/07/hacking-the-overflow-area) - it's really cool that you figured all of this out. I have a few follow-up questions:
[CoreBluetooth] API MISUSE: can only accept this command while in the powered on stateI made sure that the app has proper bluetooth and locations permissions as explained in the readme, and that bluetooth is on, airplane mode is off, etc. Do you have any thoughts on why the app would say this is powered off?
I tried making my own background bluetooth communication app from scratch, with one phone set as the advertiser and one as the receiver. (I'm able to get past the issue of bluetooth being off like was happening using your app for some reason). What I'm seeing is that when at least one phone is running the app in the foreground, the advertisement gets sent/received properly. But when both are in the background, the advertisement is not detected. So it doesn't seem like either phone is having problems transmitting or receiving advertisements in the background (since both work correctly when the other is in the foreground). Have you seen this problem before? One idea I have is that because the rate with which bluetooth advertisements are sent/scanned for decreases when the app is in the background, when both are in the background, they are sending and scanning for advertisements at different times, and thee times are not aligning for there to be a connection. Does that sound reasonable?
Regarding the "How iOS Handles Collisions" section in your article. You mention that
iOS will give a scanning callback for the colliding but different service UUID
How do I as a programmer access this callback/define the behavior for when there's a collision? What I am seeing is that if I broadcast an advertisement in the background with a few service UUIDs, where some are from your Overflow Service UUIDs by Bit Position table and some are chosen arbitrarily (not from that table), the list of service UUIDs in the advertisement received includes all of the ones from your table, but the arbitrarily chosen UUIDs are converted into different UUIDs. So it seems like the ones not from your table are being changed to other UUIDs which correspond to the same bit positions. But how do I know that it's a different UUID than what was originally advertised (since there was a "collision")? Though it would make sense to me if it's impossible to make the distinction- it's not like there's some data in the advertisement indicating that there was a collision right? So if you could just explain the "How iOS Handles Collisions" section of the article a bit more I'd really appreciate it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.