A user is having problems with my app and I've traced his log files to discover that the user never receives a background fetch opportunity. Every setting seems to be OK, including not being in lo power mode, but nothing ever happens. Users phone is iOS12. The app works fine on my iOS 13 phone and in Simulator for iOS 12.
Is there a way to determine if your app is truly registered for background fetches?
On a related note, it'd be nice to know the availability of all of these, as dictated by the user's choices in Settings:
• iCloud key,value store, NSUbiquitousKeyValueStore.default
• Notifications
• Background app refresh
• Location services
I can check the Notifications:
let center = UNUserNotificationCenter.current()
center.getNotificationSettings { settings in
guard (settings.authorizationStatus == .authorized) else {
self.logSB.error("Authorization status is NOT authorized")
return
}
self.logSB.debug("Authorization status IS authorized")
if settings.alertSetting == .enabled {
// Schedule an alert-only notification.
self.logSB.debug("Authorization alert is enabled")
} else {
// Schedule a notification with a badge and sound.
self.logSB.error("Authorization alert is NOT enabled")
}
}