1

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]) {
Display Name
  • 1,025
  • 2
  • 15
  • 34
  • 1
    [Is Silent Remote Notifications possible if user has disabled push for the app?](https://stackoverflow.com/questions/30644343/is-silent-remote-notifications-possible-if-user-has-disabled-push-for-the-app) and [ios silent push notification when user denies Push Authorization](https://stackoverflow.com/questions/26977568/ios-silent-push-notification-when-user-denies-push-authorization) – MadProgrammer Nov 04 '18 at 23:09
  • Possible duplicate of [Is Silent Remote Notifications possible if user has disabled push for the app?](https://stackoverflow.com/questions/30644343/is-silent-remote-notifications-possible-if-user-has-disabled-push-for-the-app) – mfaani Nov 04 '18 at 23:10

0 Answers0