How can I ask the user for permission to push notifications after clicking a button?

I am reading How to control when to ask the user for push notification permissions in iOS and similar issues, but they were not recorded in Swift 3.

I read five times register for push notifications in Xcode 8 / Swift 3.0? .

I started my application in Simulator again and again, but after the first time, the application never asked the user for permission to push notifications.

Did I use Registration Code for Push Notifications in Xcode 8 / Swift 3.0? and continued to try different answers and move the code to different places, so that the user asks for permission only after pressing a certain button, and not immediately after launching the application.

Do I need to register with an Apple ID, etc., so that the push notification code works even in the simulator?

+4
source share
1 answer

-, , push- . - UX. Push Notification , , Push Notifications.

push-, UIApplication registerForRemoteNotifications. , , push-, ! , . push-, . .

, registerForRemoteNotifications , .

reset push- , , Apple , :

Push Push iOS

push-push push- iOS , . , , , , .

, . , , :

  • .
  • .
  • "" > "" > " " .
  • .
+2

Source: https://habr.com/ru/post/1675669/


All Articles