GithubHelp home page GithubHelp logo

davidgyoung / backgroundadvertiser Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 6.0 39 KB

Bare bones iOS app to demonstrate how BLE service advertising works in backgrounded apps.

License: Apache License 2.0

Swift 100.00%

backgroundadvertiser's People

Contributors

davidgyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

backgroundadvertiser's Issues

Bluetooth off message, collisions, and other questions

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:

  1. When I try using the app, I see the following error:
[CoreBluetooth] API MISUSE: can only accept this command while in the powered on state
I 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?
  1. 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?

  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.