17

How to reset push notification permission on iOS

 2 years ago
source link: https://sarunw.com/posts/how-to-reset-push-notification-permission-on-ios/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to reset push notification permission on iOS

03 Feb 2022 ⋅ 1 min read ⋅ iOS

Table of Contents

On iOS, when you request permission to use notifications for the first time, the system will present the following dialog asking users to grant the permission.

Notification permission dialog. Notification permission dialog.

Once users choose to allow or deny the permission, their choice will be remembered. They can change the permission later in Settings.

App notification settings. App notification settings.

During the development, you might want to reset notification permission back to the clean state (UNAuthorizationStatus.notDetermined) to test out every possible scenario for your app, e.g., user denies the permission.

You can easily support sarunw.com by checking out this sponsor.

Stream%20Official%20Logo%20Mark@2x.png Sponsor sarunw.com and reach thousands of iOS developers.

How to reset push notification permission in iOS

To reset a push notification permission back to .notDetermined to simulate a first-time run of your app, simply delete and reinstall the app.

Delete an app and reinstall it to reset notification permission back. Delete an app and reinstall it to reset notification permission back.


You may also like

SwiftUI changes in Xcode 11 Beta 5

Highlight changes for SwiftUI in beta 5

iOS
How to use UIKit in SwiftUI

Using UIView and UIViewController in SwiftUI

iOS
Dark color cheat sheet

A cheat sheet that tells you what colors to use to support dark mode. This is a guide for those who want to adopt dark mode, but too lazy to figure out which color to use.

iOS

Read more article about iOS

or see all available topic

Enjoy the read?

If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.

Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.

If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.

Become a patron

Buy me a coffee

Tweet

Share

Previous
How to use Label in SwiftUI custom view

A guideline on how to embrace a label in your custom view.

Next
How to parse ISO 8601 date in Swift

Learn how to parse ISO 8601 date with ISO8601DateFormatter.

← Home


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK