3

I am developing an IOS app and I am checking if it is possible to communicate with other IOS devices within a close radius (like around 30 ft max) while my app is running in the background and trigger an event when a connection is made. Is this possible? I have attempted this in kivy but it did not work out. Thanks for any responses in advance!

Python 123
  • 59
  • 1
  • 13
  • 1
    30 feet is within bluetooth distance (I think), so MultipeerConnectivity should work, but note that you can't do much when your "app is running in the background". IIRC you only get about 10 minutes maximum after your app goes into background to run arbitrary code. After that you're not allowed to do anything. – Sweeper Apr 16 '21 at 03:29
  • 1
    See [this](https://stackoverflow.com/questions/51131100/swift-running-code-in-periodically-background) for example. – Sweeper Apr 16 '21 at 03:33
  • Theres no way around the restrictions for running in the background? – Python 123 Apr 16 '21 at 22:20

1 Answers1

1

If this is communication between two iOS devices then yes this is theoretically possible given that 30ft is well within the Bluetooth/BLE range. I've worked with apps were background operations were possible for +20meters (~60ft) without an issue, and this would've extended even further if the RF environment isn't busy. That being said, practically there are many variables that affect this including the environment that you are in, the type of the phone, if the phone has a case, and if you are in fact communicating between two phones etc. I would still think that 30ft is achievable in most cases, but it cannot be guaranteed 100% of the time. The links below talk about the theoretical vs practical Bluetooth range:-

As for background processing for iOS apps, Apple have a very useful detailed guide on how to get this working and I've left a few useful links as well:-

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
  • That's alright 30 feet was just an estimate it will usually be closer. I was most concerned with running in the background which you solved. I will give you the bounty when it allows me to. Thank you for your answer! – Python 123 Apr 18 '21 at 17:06