I'm trying to create a UISwitch so user can choose not to get push sounds from inside the app. Is it possible? i've tried to register again without sound -
+ (void)registerToNotificationWithoutSound
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeAlert)];
}
}
and all is does is disable the users ability to toggle between sound on/off in the iphone settings, but still remembers what the user chosen when the ability to toggle was available.
for example - if the user enables the push sound from the iphone settings and than disable it from the app - he now cant see or use ,the notification sound toggle switch, on the iphone settings but still get sound when receiving push.
thanks