Roy K
Roy K

Reputation: 3319

iOS 7 Local notifications with no sound by default

When I run the app on my iOS 7 device, the app doesn't appear on the device notifications settings and doesn't sounds when a notification is being fires. Only after the first notification is being fired, I can see my app under the list of the notification settings with sounds turned off.

  1. Why doesn't the app show in the notifications list initially?

  2. Why are the sounds turned off by default?

On iOS 5&6 I don't have these problems. These are local notifications.

Upvotes: 13

Views: 3050

Answers (4)

Abdul Yasin
Abdul Yasin

Reputation: 3508

Hmm, Interestingly, I changed the order of

notification.SoundName = UILocalNotification.DefaultSoundName; notification.ApplicationIconBadgeNumber = 1;

to

notification.ApplicationIconBadgeNumber = 1; notification.SoundName = UILocalNotification.DefaultSoundName;

and it works now. When the app is running in background, the local notification fires and plays the default notification sound.

Upvotes: -1

adiman
adiman

Reputation: 518

I got this same problem. What i found out was, i have a piece of code that caused this all along.

In my AppDelegate didFinishLaunchingWithOptions, i have implemented:

//remove this if you have it
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0]; //to reset the badge everytime the app loads

So what i did, I removed that code & redeploy the app. Now it has ON default value in Notification Center.

Phew.

Upvotes: 0

user3026667
user3026667

Reputation: 11

Have you set the applicationIconBadgeNumber in "- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions"? Comment this code, and try again.....I don't why, but I got the same problem. After I commented this line, my app works correctly.

Upvotes: 1

Roy K
Roy K

Reputation: 3319

It looks like iOS 7.0.3 includes a fix for that.

Upvotes: 2

Related Questions