In my iOS app I have some things that need permissions from user. For example : permissions to receive push-notifications.
I want to ask such users for enabling permissions once in a while until they will approve it. I don't want to ask each time user launches app.
I have function that opens app settings where user can enable notification
extension UIApplication {
class func openAppSettings() {
if #available(iOS 8.0, *) {
UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)
}
}
}
I thought about storing the date of last permission request and each time the app launches - check how many days ago user was asked for permissions last time. I don't know why but it seems not elegant for me.
Could you please suggest more elegant way to solve it?