I'm working on a app that can communicate, send and receive data from our own MFi scanner.
Ideally, this app can receives data and remains communication even when it's in background, but I can only runs a background task for maximum 30 sec.
Along with this main app, we also have a keyboard extension as an interface that can publish collected data to other app that user prefers with string format.
However, It seems like Apple doesn't allow to implement UIApplication.shared.beginBackgroundTask
method in extension class, is there any alternative that worth to try?
Also, can I extend app background task time elapsed to at least 30 minutes?
If I can get an official response would be great!
If I can get an official response would be great!
To be clear, DevForums is not an official support channel [1]. If you need that, you should open a tech support incident, either with DTS or via the MFi program.
You have two specific questions. The first is:
It seems like Apple doesn't allow to implement
UIApplication.shared.beginBackgroundTask
method in extension class, is there any alternative that worth to try?
Yes. App extensions can use ProcessInfo
for this. My UIApplication Background Task Notes post has links to docs and so on.
Also, can I extend app background task time elapsed to at least 30 minutes?
No. I talk about this is in both UIApplication Background Task Notes and iOS Background Execution Limits.
There may be some cunning way to get around this limit using EA stuff, but I don’t have any suggestions on that front. It’s not a technology that I support.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Although, if a DevForums post links to documentation, that’s probably as official as you’re going to get.