I have push notifications in my app. Whenever the app is launched, I would like to check whether the user has enabled push notification for my application.
I do it this
Short answer: No, if a user has denied your request for push notifications you cannot ask them again, you should point them to the settings page, you can do this with an alert informing them of the steps and two options "Ok" and "Go to settings", this is where you'd use Roman's code.
Long Answer: You should only ask the user for push notifications when you absolutely need to AND if you're going to ask it helps to preface with a little view explaining why you want/need to send push notifications, this is a great TechCrunch article that will help you get better retention/acceptance from your users - http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/