Also note that you cannot safely call *any* of the Android notification plugin’s API upon application exit. This includes the plugin’s cancelNotification() function. If you’re calling other notification APIs too, then you’ll need to switch those over to the system API on Android as well.
I’ve confirmed that the system notification API works with the following “main.lua” code. It’ll generate a schedule notification upon app exit.
-- The notification plugin will crash if you call an API while backing out of the activity. -- It will not crash if you use the deprecated "system" notification API. local notifications = require("plugin.notifications") local function onSystemEvent(event) if (event.type == "applicationExit") then local scheduleNotificationCallback if (system.getInfo("platformName") == "Android") then scheduleNotificationCallback = system.scheduleNotification else scheduleNotificationCallback = notifications.scheduleNotification end scheduleNotificationCallback(2) end end Runtime:addEventListener("system", onSystemEvent) local textSettings = { text = "Press the BACK key to reproduce the notification bug.", x = display.contentCenterX, y = display.contentCenterY, width = display.contentWidth \* 0.9, align = "center", } display.newText(textSettings)