To unregister from Remote Notifications programatically you can use
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
UIApplication.sharedApplication().unregisterForRemoteNotifications()
this is similar to going into the setting of your phone and manually switching off Notifications for the application.
NOTE: There may be rare cases where you would need this(eg: when your app no longer supports push notifications)
If you just want to allow the user to temporarily disable Notifications. You should implement a method to remove device token in the database on your server. else if you only disable Notification locally on your device your server will still send messages.