system.scheduleNotification is not working as expected.

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) but it returns nil. 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…

notifications[#notifications+1] = system.scheduleNotification( nextRefreshTime, options )
print(notifications[#notifications]) – Prints nil !?!

print( system.scheduleNotification( nextRefreshTime, options ) ) – Also prints nil !?!

p.s: I also tried system.scheduleNotification with utcTime argument.