开发者

How can i fetch Push Notification settings in my app?

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 Infor开发者_开发百科mation 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.


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/


 - (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
       if ([application enabledRemoteNotificationTypes] & UIRemoteNotificationTypeSound) {
         AudioServicesPlaySystemSound(0x3f4);
         AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
        }
     }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜