Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Question about app reinstall in iOS 8 #227

Open
abellee opened this issue Apr 6, 2017 · 0 comments
Open

Question about app reinstall in iOS 8 #227

abellee opened this issue Apr 6, 2017 · 0 comments

Comments

@abellee
Copy link

abellee commented Apr 6, 2017

I read about your code, and found you have set UserDefaults to record the app whether requested, just like the Notification.
But in iOS 8, if users denied the Notification, system will remember the setting, then if the user uninstall the app and reinstall it, the requested record is definitely false, but the types of UIApplication.shared.currentUserNotificationSettings is definitely not equals to the UIUserNotificationType(),
so the logic will goes to the unknow,
I should call the first time Notification request here, right?
but I think the request alert will not appear, isn't it?

I did the testing like this:
if let types = UIApplication.shared.currentUserNotificationSettings?.types, types != UIUserNotificationType() {
Log.verbose("authorized");
}else{
if let bool = UserDefaults.standard.value(forKey: "test") as? Bool {
if bool {
Log.verbose("unauthorized");
}else{
let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil);
UIApplication.shared.registerUserNotificationSettings(settings);
Log.verbose("unknown");
}
}
}
just like what I said, the request alert is not appear after I reinstall the app if I denied before,
iOS 8.1 ~ 8.4 simulator are all not working.

so I think whether should to keep the requested record in KeyChain if iOS 8.1~8.4,
otherwise keep it in UserDefaults?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant