I'm trying to implement an app with a local notification system. The system should cancel some unnecessary notifications. System.scheduleNotification works fine (it creates notifications and they work fine) but it returns nil
(It supposed to return an ID). So I'm not able to cancel any notifications by notification id.
Actually the code I use is very simple. Any help would be helpful...
local nextRefreshTime = 60 -- Not always 60, its just an example
local options = {
alert = "Some text here.",
badge = ( native.getProperty( "applicationIconBadgeNumber" ) or 0 ) + 1,
}
notifications[#notifications+1] = system.scheduleNotification( nextRefreshTime, options )
print(notifications[#notifications]) -- Prints nil !?!
-- Another example (test)
print( system.scheduleNotification( nextRefreshTime, options ) ) -- Also prints nil !?!
p.s: I also tried system.scheduleNotification
with utcTime
argument.