Local notifications are now known as User Notifications in Swift 3 and iOS 10. They can take 3 forms – badges, sounds and alerts (the latter appear on the lock screen).

To set them up in Swift 3 do the following:

1. Use UserNotifications by importing it:

1. Ask for permissions (yes, you need to ask permission for EVERYTHING in Apples’ world). Grab the applications shared instance and feed it the types of alert you need (you need at least one):

When the above is fired you can expect a notification on the users screen – asking for permission!

2. Create the content of your notification:

3. Create a scheduled time to fire it:

4. Ask iOS very nicely if it wouldn’t mind scheduling this:

And you’re done! Try this out and see if it gives you a message within 5 seconds!

Creating User Notifications in iOS 12 – Formerly Local Notifications
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share This

Exhausted by your 9 - 5?

Would you prefer to work for half the time and earn double? The first step to your freedom is understanding how apps make money. Simply enter your email below and I will send you a free PDF describing the process.

If you're serious about improving your life then do not miss this opportunity.

You have subscribed! Please check your email to confirm this subscription and to receive your item!