In iPhone app,
I am setting the local notification.
I am setting custom sound.
I could not 'hear' any sound when notification comes. Not even default sound.
Neither in my iPod touch nor in my device.
Any body can help me to find out the reasons ?
Thanks very much.
here is code.
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate=[dateFormat dateFromString:alarm_date];
localNotification.alertBody = @"Alarm.";
localNotification.soundName = [filePath lastPathComponent];
//localNotification.soundName =soundname;
//UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = 1;
localNotification.alertAction=@"Show";
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
Answer Got the Silly Point : Notification sound all only play when your app is in the background or closed. Sorry for this question. Any way thanks.
the sound should be less than 30 seconds to be played as a notification sound
other thing:
According to the Apple Developer Documentation, you need to use "aiff", "caf" or "wav" files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With