Hey there
To ensure that your app supports background delivery, the following must be completed:
- Add the Background Modes capability and enable Background Processing and Background fetch. This can be done by opening your
.xcodeproj
file in XCode, navigating to Signing & Capabilities
and pressing + Capability
- Add the HealthKit capability and enable Background delivery
- Add the terra Background task identifier: navigate to your
.xcodeproj
> Info
and create/edit the list Permitted background task scheduler identifiers
and add the element co.tryterra.data.post.request
- In the same tab, the key
Privacy - Health Share Usage Description
should be created with the value being a description of your use case (which must be > 2 words)
- Add the following to your
AppDelegate
file:
import UIKit
import TerraiOS
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
Terra.setUpBackgroundDelivery()
return true
}
}