registerForRemoteNotificationTypes is deprecated in ios8. Use registerUserNotificationSettings and registerForRemoteNotifications if device is on ios8.