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.
The exposure notification feature is designed to automatically send you a notification if you've been in proximity to a person who is diagnosed with COVID-19. But if you're concerned that you've missed a notification or should have had one, you can manually check for them on your iPhone by following these steps.
You can configure expo-notifications using its built-in config plugin if you use config plugins in your project (EAS Build or expo run:[android|ios] ). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect.
Are you building the app for corona simulator
? Then it won't work. Build it for Xcode simulator
for testing local notifications. A sample project(from corona Sample Code
) output image is shown below:
And the code is:
local options = {
alert = "Wake up!",
badge = 1,
sound = "alarm.caf",
custom = { msg = "bar" }
}
notificationID = system.scheduleNotification( time, options )
local displayText = "Notification using Time: " .. tostring( notificationID )
print( displayText ) -- It will print the user data
Keep Coding.............. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With