ScheduleNotification not working correctly on Kindle HDX

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?

Hi Alan,

Notifications are now a plugin, so you shouldn’t use them through the system.* library any longer, including the schedule call. See the updated docs here:

http://docs.coronalabs.com/daily/plugin/notifications/index.html

Brent

I’m currently using Enterprise build 2015.2541, so that we didn’t have to change over to the new notification plugin as we were submitting.  

I’ll try out the new plugin shortly and see if that fixes it.

Hi Alan,

Notifications are now a plugin, so you shouldn’t use them through the system.* library any longer, including the schedule call. See the updated docs here:

http://docs.coronalabs.com/daily/plugin/notifications/index.html

Brent

I’m currently using Enterprise build 2015.2541, so that we didn’t have to change over to the new notification plugin as we were submitting.  

I’ll try out the new plugin shortly and see if that fixes it.