Page 1 of 1

Play sound file with local notification

Posted: Thu Jul 04, 2013 11:17 pm
by doobox
Hi there,

As far as i can see it is not possible to play a sound file when a local notification is presented..?
Can someone confirm this please.

If this is the case, can an external be created..?

I read somewhere that its not possible with the ios public api, but Appcelerator can do this within its api, so i have to assume this can be done in some way.
I would also need the sound file to loop for as the notification will be an alarm.

Re: Play sound file with local notification

Posted: Fri Jul 05, 2013 10:11 am
by Mark
Hi,

What have you tried so far? By "local notification", do you mean an answer dialog? Or do you mean a local push notification? In case of local push notifications, I think it is up to the user to determine in the control panel whether to play a system sound or not. This is a privilege the programmer doesn't have. If you do mean push notifications, then you posted in the wrong place. Move this question to an iOS or Android forum.

Kind regards,

Mark

Re: Play sound file with local notification

Posted: Fri Jul 05, 2013 10:36 am
by doobox
Hi there,

I basically want to schedule an alarm. And had stated building the app without looking at this portion properly, assuming i could do this with local Notifications.

It looks like i can't, as the local notification is only capable of playing a system sound (1 time) when the app is not in use :-(

So how are all the alarm clock apps out there handling this :
The user sets an alarm time.
The app schedules the alarm ( with message, sound file etc etc).
The user closes the app.
The notification and alarm still fires and plays until interacted with.

Looking at the iOS sdk it looks like there is a UILocalNotification class with tasks that i need :
firedate
repeatinterval ------------ the important one i need to loop the sound file i think
repeatcalender

alertbody
alertaction
alertlaunchimage
alerticonbadgenumber
soundname --------------- the important one i need


reading between the lines, it looks to me that this is the class that "mobileCreateLocalNotification" is based on..?
But it is obviously not fully implemented if this is the case.

So from what you said, if i had an external that fully implemented this class, could the users prefs still be disabling the sound file attached to this notification..?

Re: Play sound file with local notification

Posted: Fri Jul 05, 2013 6:45 pm
by doobox
@Mark
I have been trying to find a way to contact you regarding building externals, but there is some problems with your site.
Do you have a direct email i can get you on..?
I am : sales at doobox dot co dot uk

Re: Play sound file with local notification

Posted: Wed Aug 08, 2018 4:31 am
by Jim Mac
Has this been answered?

I am using local push notifications to show banners reminding people to check my app based on a schedule they define.

My original desire was to have the user also select a sound to accompany the banner... I've seen some apps do this. Unfortunately I have had zero luck with systemBeep or anything else in geting sounds to accompany teh banner. I can get my app to play a sound once opened in response to the banner but that's backwards behavior.

Would having my app active in the background be the way to go... so it's available to play whatever sound I want (invisibly when the banner is showing?). I don't even know if it's possilbe to access the OS's built in sounds.

Jim

Will likely cross post this to the iOS board.

Re: Play sound file with local notification

Posted: Wed Aug 08, 2018 3:25 pm
by Mikey
My apps play sound when they receive a push notification when the app isn't open. It's not a custom sound though.

Re: Play sound file with local notification

Posted: Thu Aug 09, 2018 6:58 pm
by jacque
It's a system setting, the user has to turn it on. On Android notifications can be granular down to the individual app, I'm not sure about iOS.