Requesting User Authorization for Notifications with async/await

By the end of this tutorial, you will be able to request authorization to send notifications using the UserNotifications framework.

Requesting User Authorization for Notifications with async/await

If you want to create user-oriented notifications in your iOS application, you might stumble across two frameworks with very similar names, Notification Center and User Notifications.

The correct framework to use if you want to schedule local notifications in your iOS application is the User Notifications framework. Even though they have very similar names they have very different functionalities. In fact, the Notification Center framework is being replaced by WidgetKit right now.

To be able to send notifications to the user of your application you must first ask for authorization. In this tutorial, we will cover how to request authorization and how to check the current authorization status for your application.

Since Swift 5.5 brought the concepts of async/await, most of the asynchronous methods and functions of various frameworks have been updated to support it. This tutorial will focus on the asynchronous version of these functions.

Become a free member or log in to proceed.