I’ve constructed an app for shut household and mates to make use of. I can not add the app to the App Retailer as I am utilizing copyrighted materials/belongings so I am utilizing TestFlight to distribute the app to permit my household and mates to make use of it.
I’ve carried out native notifications within the app utilizing UserNotifications, UNUserNotificationCenter, and so on.. I schedule two notifications per week that ought to be delivered on the similar time each week, every on separate days of the week. Nonetheless, my private system is the one one that’s truly receiving these notifications, and everybody considered one of my ‘customers’ who downloaded my app through TestFlight don’t get these notifications. I’ve verified that my ‘customers’ do have notifications turned on for my app.
Initially I adopted a YouTube video on methods to implement native notifications. The strategy proven within the video makes use of the completion handler APIs of UserNotification. I’ve additionally tried experimenting with utilizing the async APIs as an alternative since my app follows async await structure however this did not assist.
Though possibly not greatest observe, my implementation is as follows:
- When person masses app, run loop to schedule all ~30 notifications.
- In every iteration, create the notification with a novel identifier per notification.
- Take away any pending notifications matching that identifier.
- Add the created notification to the queue.
I additionally ask for person permission to ship notifications like this:
func checkForNotificationsPermission() {
let notificationCenter = UNUserNotificationCenter.present()
notificationCenter.getNotificationSettings { settings in
swap settings.authorizationStatus {
case .licensed:
self.dispatchNotifications()
case .notDetermined:
notificationCenter.requestAuthorization(choices: [.alert, .sound]) { didAllow, error in
if didAllow {
self.dispatchNotifications()
}
}
default:
return
}
}
}
the place dispatchNotifications()
follows steps 1-4 above.
My greatest assumption is that the notifications work for me as a result of I am the account that is tied to the developer account and I’ve some certificates to permit notifications however I do not know for positive. All of the folks utilizing my app through TestFlight are added to my App Retailer Join with the function of “Advertising and marketing”.