Search code examples
ioseaaccessory

Start app if its not running in background and received EAAccessoryDidConnectNotification


I am developing an iOS app that will stream music to my car using EAAccessory. It works great if I have app running and is open and also works good if app is in the background. But I was just wondering if its possible to start the app if its not running at all(not even in background) and start streaming music as soon as didConnectNotification is received.

Any help would be greatly appreciated. Thank you.


Solution

  • If your app is suspended after however long the phone decided to let it run or not running at all, that notification is going to get enqueued. When your app runs again it will then receive the notifications it missed in the queue. So if you miss that window where you are backgrounded before you're killed or simply not running, EAAccessoryDidConnectNotification won't be able to bring your app out of suspension or cause it to launch as far as I know.