0

I am coming from Android to IOS and need to implement push notifications. I am using AWS Pinpoint, which uses APNs, and so far everything is working. However, I see that user is asked if he wants to permit notifications or not...

Is there some way to send push notification (perhaps without displaying it, but just delivering JSON data within app) without asking permission?

Viktor Vostrikov
  • 1,322
  • 3
  • 19
  • 36
  • it's strange how this isn't a permission in android – Shehata Gamal Mar 19 '20 at 13:27
  • Does this answer your question? [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) – dan Mar 19 '20 at 13:44
  • @dan I would still need to ask for permissions, yes? – Viktor Vostrikov Mar 19 '20 at 14:15

1 Answers1

0

Is there some way to send push notification (perhaps without displaying it, but just delivering JSON data within app) without asking permission?

No there isn't , there should be an alert to allow sending notifications whatever it's configured with notification/data , for no sound/alert set this remove options

let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
                options: authOptions,
                completionHandler: {_, _ in })

Note also set

content-type = 1

in payload

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87