Reputation: 21091
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?
Upvotes: 0
Views: 301
Reputation: 38667
Elegant ways:
ask for permission again right after user has made an (in-app) purchase, arguing you want to alert for future offers
ask for permission again right after user has made a (remote) subscription/reservation, arguing you want to alert for the event/booking/delivery status
ask for permission again right after user has triggered an (in-game) action that will take more than 1 hour to be accomplished, arguing you want to alert for completion-status
If your app does not provide services for purchasing anything, does not trigger anything with real-life impact, and does not have long gaming sessions, then it may reveal that you have no meaningful trigger for those notifications.
Upvotes: 1