Local Notification no Sound?

Hi,
i implemented the new Push Notification Feature (only local)
works fine
local options = {
alert = “Pill Reminder”,
badge = 1,
sound = “alert_45.aac”,
custom = { anythingYouWant = “My Days Notification” }
}
local myNotification = system.scheduleNotification( 2, options)
–sound_mydays = audio.loadSound(“alert_45.aac”)
–audio.setVolume(0.5, { channel=1 } )
–audio.play(sound_mydays,{ channel=1 } )

Put the Sound does not appear? Do I forgot something.
I could add it manually in the

local function notificationListener( event )

but i guess sound = … is there that it works :slight_smile:

Its not on the audio file (i outcomented it in the code above to test if its the .aac, )
that works fine. and yes the audio is in my main resource folder (where my main.lua is)

Any Idea?

greets
chris

p.s. also it looks the ansca description for local notifications is wrong
ansca mention it would increment by the ‘badge’ number
instead apple states (and thats how it behaves with me)
“The number to display as the badge of the application icon. If this property is absent, any badge number currently shown is removed.”
[import]uid: 4795 topic_id: 16034 reply_id: 316034[/import]

OK :slight_smile:

  1. is answered.
    Custom alerts must be in one of the following audio data formats:

Linear PCM
MA4 (IMA/ADPCM)
µLaw
aLaw

packed in an aiff, wav, or caf file.

possiblity to transform a .aiff into a caf in terminal (with xcode)

afconvert /System/Library/Sounds/Submarine.aiff ~/Desktop/sub.caf -d ima4 -f caff -v
[import]uid: 4795 topic_id: 16034 reply_id: 59519[/import]

About the Badge Number I am still confused.

I had badge = 5
than I mad badge = 1 … and it did came 1 … not 5 as in ansca doc

ok. i thought its like in the apple doc.

i made badge = 0 … nothing changed … still shows 1
i out commented badge (apple states it should come removed) result still 1

now i made -5 (as in ansca) and it came removed ??

as it works with add and deduct… its quiet hard to know ‘whats actual shown’ in the badge??
is there any option to request that?

Also the badge only comes updated when the notification pops up while the app is in the background.
Not when the local alert (when notification is called, but app in foreground)

is there a way i can change the badge number manual in any way (if app is foreground or background) to a fixed nr i choose?

so from my experience now it looks… the badge is shown as defined
but to remove it… you have to make actual number - actual number to remove it :slight_smile:
thx
chris
[import]uid: 4795 topic_id: 16034 reply_id: 59532[/import]

chris,
I had tested and have the same bug mentioned here

You are right, that Apple documentation does mention that the badge number is not automatically added, but set

therefore there is a function to get the badge number and a function to set the badge number.

I guess Ansca needs to add the Get and Set functions

I am still having issues in getting to *view* the notification when spawned.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16034 reply_id: 59658[/import]

Hi JayantV,

my english is not good enough to understand what you mean with “spawned” in this context :slight_smile:

you may provide an example.
and good to hear also someone else see, that badge also in ansca is just SET (whats fine for me)
but has to be removed with badge = actualbadgenr - actualbadgenr (now we just need to know whats actualbadgenr :slight_smile:

also put the listener etc all in you main.lua, there you show your local alert notification

greets
chris
[import]uid: 4795 topic_id: 16034 reply_id: 59681[/import]

Hi Chris,
No worries…

I just meant that I did not test the sound, but I got the notifications, so when asked what would I want to do, Close or View? If I chose View, the app gets spawned (started) and it is then supposed to show the notification to me, Johnathan has posted a tute that clarifies how the same can be achieved, but it did not work for me.

I could still not see the details of the Notification despite selecting view.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16034 reply_id: 59683[/import]