0

I tried to implement a simple demo application which handles communication with BLE devices while the application is put in background mode by the user. However, the communication seems to be suspended a couple seconds after the application is put in background.

I tried to document myself about L2CAP communication in the background and found some posts stating that L2CAP communication is not supported in the background. I wonder if someone has achieved what I'm trying to.

faku
  • 411
  • 4
  • 19
  • Does this answer your question? [How to make an android app to always run in background?](https://stackoverflow.com/questions/34573109/how-to-make-an-android-app-to-always-run-in-background) – Risto Apr 27 '23 at 07:51
  • I have just seen that the question refers to ios. Therefore your application needs to instantiate a [BackgroundTask](https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background#3222193) – Risto Apr 27 '23 at 08:07
  • 2
    L2Cap is not supported in the background for extended periods. You can use `beginBackgroundTaskWithExpirationHandler` to get up to 180 seconds of execution. – Paulw11 Apr 27 '23 at 09:29

0 Answers0