I added Push notifications to my application. And my application works based on push notifications. When the app runs for the first time, it is showing alert whether user wants
If your app target >= iOS 8.0 you can use:
iOS 8.0
UIApplication.sharedApplication().isRegisteredForRemoteNotifications()
as enabledRemoteNotificationTypes is deprecated.
enabledRemoteNotificationTypes