tags:

views:

21

answers:

1

How can we switch off notification from device?

A: 

Remote (Push) Notifications

If you are talking about remote (push) notifications, you can unregister for remote notifications using the - (void)unregisterForRemoteNotifications method in UIApplication (see the class reference).

However, Apple notes that users can disable push notifications on their own:

You should call this method in rare circumstances only, such as when a new version of the application drops support for remote notifications. Users can temporarily prevent applications from receiving remote notifications through the Notifications section of the Settings application. Applications unregistered through this method can always re-register.

Local Notifications

If you're talking about local notifications, you can use the - (void)cancelLocalNotification:(UILocalNotification *)notification or - (void)cancelAllLocalNotifications methods, also on UIApplication (see the class reference).

GregInYEG
Thank you for your response. My concern is about push notification. Can I disable them through device? I mean not thru code something in settings of device?
Abhinav
Yes, as it states in the blockquote from Apple in my answer: "Users can temporarily prevent applications from receiving remote notifications through the Notifications section of the Settings application."
GregInYEG
Thanks you so much. I missed that line :).
Abhinav