Lua中Corona的system.scheduleNotification为何无法启动?
- 内容介绍
- 文章标签
- 相关推荐
本文共计348个文字,预计阅读时间需要2分钟。
我正在尝试使用本地通知系统实现应用功能。系统自动取消了一些不必要的通知。`System.scheduleNotification` 工作正常(它创建通知,它们正常工作),但它返回 nil(它应该返回一个 ID)。因此,我无法通过通知进行操作。
我正在尝试使用本地通知系统实现应用程序.系统应取消一些不必要的通知. System.scheduleNotification工作正常(它创建通知,它们工作正常),但它返回nil(它应该返回一个ID).所以我无法通过通知ID取消任何通知.实际上我使用的代码非常简单.任何帮助都会有所帮助……
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:我还尝试使用utcTime参数进行system.scheduleNotification.
代码是:
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
保持编码…………..
本文共计348个文字,预计阅读时间需要2分钟。
我正在尝试使用本地通知系统实现应用功能。系统自动取消了一些不必要的通知。`System.scheduleNotification` 工作正常(它创建通知,它们正常工作),但它返回 nil(它应该返回一个 ID)。因此,我无法通过通知进行操作。
我正在尝试使用本地通知系统实现应用程序.系统应取消一些不必要的通知. System.scheduleNotification工作正常(它创建通知,它们工作正常),但它返回nil(它应该返回一个ID).所以我无法通过通知ID取消任何通知.实际上我使用的代码非常简单.任何帮助都会有所帮助……
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:我还尝试使用utcTime参数进行system.scheduleNotification.
代码是:
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
保持编码…………..

