Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-09-2011, 04:24 PM   #1 (permalink)
New To iOS
 
Join Date: Nov 2011
Location: Waterloo, ON
Age: 20
Posts: 187
RileyE is on a distinguished road
Default Change Local Notification Sound

Hi,

I'm currently trying to change the sound of my local notification, but its not working. I'm trying this:

Code:
localNote.soundName = [[NSBundle mainBundle] pathForResource:@"itimer" ofType:@"caf"];
But its not changing the sound. I know that is the correct path, because I use it elsewhere in my code successfully. I don't have any errors in my code when I run it and the debugger never catches a problem when the sound is supposed to occur. It just plays the default sound, instead.
RileyE is offline   Reply With Quote
Old 12-09-2011, 04:28 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Pass it just the filename.

localNote.soundName = @"itimer.caf";
baja_yu is offline   Reply With Quote
Old 12-09-2011, 05:48 PM   #3 (permalink)
New To iOS
 
Join Date: Nov 2011
Location: Waterloo, ON
Age: 20
Posts: 187
RileyE is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Pass it just the filename.

localNote.soundName = @"itimer.caf";
The sound still plays through with the original tritone sound, though.

EDIT: I'm not sure what the difference between:

Code:
localNote.soundName = @"itimer.caf";
and

Code:
localNote.soundName = @"itimer.caf";
is, but its working now. I seriously wrote exactly what I had already written (just commented out), but this time it worked. I don't know why it didn't work, but I won't question it, since its working.

Thank you!

EDIT #2:

This is exactly what I had, plus the new line:

Code:
    localNote.soundName = @"itimer.caf";
    /*localNote.soundName = @"itimer.caf";
    localNote.soundName = [[NSBundle mainBundle] pathForResource:@"itimer" ofType:@"caf"];
    [localNote setSoundName:[[NSBundle mainBundle] pathForResource:@"itimer" ofType:@"caf"]];
    [localNote setSoundName:UILocalNotificationDefaultSoundName];*/

Last edited by RileyE; 12-09-2011 at 05:53 PM.
RileyE is offline   Reply With Quote
Old 12-09-2011, 05:58 PM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Only the last call will really matter so the local notification will play the default sound. That's why it wasn't working.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 12-09-2011, 06:28 PM   #5 (permalink)
New To iOS
 
Join Date: Nov 2011
Location: Waterloo, ON
Age: 20
Posts: 187
RileyE is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Only the last call will really matter so the local notification will play the default sound. That's why it wasn't working.
Oh. Those were just the previous call attempts that I had. I just slowly added them to a comment block of failures. Only one was uncommented at a time.
RileyE is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 411
13 members and 398 guests
7twenty7, AppsBlogger, David-T, Duncan C, EvilElf, HemiMG, heshiming, iekei, LunarMoon, Murphy, sacha1996, Sami Gh, teebee74
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:45 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0