私はローカル通知システムでアプリケーションを実装しようとしています。システムは不要な通知を取り消す必要があります。 System.scheduleNotificationは正常に動作し(通知を作成して正常に動作しますが)、nil
(IDを返すと想定されます)を返します。通知IDで通知をキャンセルすることはできません。Corona、system.schedule通知が正しく機能していません
実際に使用するコードは非常に簡単です。すべてのヘルプは...
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
を試してみました。
私はデバイスとxcodeシミュレータを試しました。この例を試してみましょう。私はそれがコロナサイトにあると仮定します。返信ありがとう。 –