Q:

Graceful way to handle when user refuse to enable required services

I've been googling on how to gracefully handle when user refuse to enable  push notification service and location service that my app requires. I found out that Apple's human interface guideline prohibits developers from exiting app programatically and it should be left with users. But I don't want user to use my app without those services enabled since they are neccessary. How do accomplish that without violating any guidelines Apple laid out? 

A:

Well, I would just display a static view that explains why those services are required and how the user can enable them - best by offering a button that will redirect to the settings (Swift 3 code):
// in Button handler code:
if let appSettings = URL(string: UIApplicationOpenSettingsURLString) {
    UIApplication.shared.openURL(appSettings)
}

