I'm a newbie on swift and WatchKit framework.I'm studying this from only a month.Now my question is:is possible running an app in background mode on the apple watch?I read from the documentation that the WatchKit extensions do not support background execution modes.But if this thing is true how to work apps like health app?I mean,on the watch there is an app called health that takes at each instant of time your hearth rate even if the app is not in foreground.I would do the same thing more or less.In my app I would detect the user acceleration only when the user move the watch even if the app is not in foreground.How can I do? Please to post me the necessary documentation to do so.Thanks a lot!
Ps. sorry for my english!
Yes, you can. There are several ways:
WKSnapshotRefreshBackgroundTask
or WKURLSessionRefreshBackgroundTask
. They are listed in Background Tasks section of this article.performExpiringActivity(withReason:using:)
can be used to shortly prolong life of the app when it goes to the background.Also, read Leveraging iOS Technologies.