Im developing a swift app that uses data from a server. To initiate the 'get data' command I'm using APNS with a message body of
$body['aps'] = array(
'content-available' => 1
);
This obviously triggers
func application(
_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
and I then call function to get server data.
As im not showing a notification do I have to ask the user for permission? i.e.
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {