Reputation: 147
I am developing an iphone application which includes and process apple push notification for the custom sound file. When I set notification sound off from the general settings, notification sound is off as i expect, when app is not in running state. But when the app is in running state then i need to handle sound play or stop manually. So how can i fetch the notification sound related settings, whether it seted on or off? I am able to fetch following settings in didReceiveRemoteNotification method
alert = New UFO Information received, badge = 1, sound = Alarm1.wav
If anybody have any idea about to fetch general settings like alert sound is on or off please help.
Thanks in advance.
Upvotes: 3
Views: 690
Reputation: 81
First check your app staust and open push notification setting with this code.
For iOS 5 and later vesion.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=NOTIFICATIONS_ID"]];
For open any setting of iphone app check this link.
http://www.makebetterthings.com/iphone/open-settings-app-in-iphone-using-open-url-scheme/
Upvotes: 2
Reputation: 679
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if ([application enabledRemoteNotificationTypes] & UIRemoteNotificationTypeSound) {
AudioServicesPlaySystemSound(0x3f4);
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}
}
Upvotes: 0