Our local notifications work just fine on our Google Play builds, but for some reason on our Amazon builds they do not get triggered unless the time is set to 0 (i.e. trigger them immediately).
Here is the code being used:
local options = { alert = { title = "Here is my title", body = "here is some body text", number = 5 }, badge = 0, sound = "mysound.wav", } system.scheduleNotification( 60, options)
This should set off the notification in 60 seconds, but it never happens.
I noticed something else rather odd, and I don’t know if this is related:
local time = os.time() local dtime1 = os.date( "!\*t", time ) for k, v in pairs(dtime1) do print(k, v) end local time2 = time + 300 local dtime2 = os.date( "!\*t", time2 ) for k, v in pairs(dtime2) do print(k, v) end
If I print the value of ‘time’ and ‘time2’, they are 300 seconds apart, as expected. However if the values printed in the in-pairs loops show exactly the same time as each other. I would’ve though that I’d made a mistake there, but in this doc a similar method is used to add 60 seconds to the time:
http://docs.coronalabs.com/api/library/system/scheduleNotification.html#example
local utcTime = os.date( "!\*t", os.time() + 60 ) notificationId = system.scheduleNotification( utcTime, options )
Does anyone have any ideas what could be happening here?