android – Corona sdk顯示多行通知

我在Corona有一些通知.問題是,文字太大,我需要顯示更大(多行)的通知,例如Gmail應用程序.以下是通知現在的樣子:

android – Corona sdk顯示多行通知
android – Corona sdk顯示多行通知

這是我的程式碼:

local notificationOptions =
{
  alert = text,
  badge = 2,
  sound = "alarm.caf",
  custom = { foo = "bar" }
}

 local notification = notifications.scheduleNotification( nextScheduleTime +  ( day + math.floor(day/7)) * 24 * 60 * 60, notificationOptions )

知道怎麼做嗎?

預設情況下,通知不提供多行.

要使用多行,必須使用Java( sample )中的NotificationCompat.BigTextStyle()或使用自定義或本機自定義檢視( example ).

不幸的是,我還沒有找到如何觸控預設檢視以覆蓋

手冊:

https://docs.coronalabs.com/daily/guide/events/appNotification/index.html#TOC

和這裡:

https://docs.coronalabs.com/daily/plugin/notifications/scheduleNotification.html

在第二個連結中,您可以看到只使用了以下屬性:

alert (optional) String. The notification message to be displayed to  the user. If the application is not currently running, a system alert  will display this message. badge (optional) Number. The badge number  to be displayed on the application icon when the scheduled  notification triggers. This replaces the last badge number that was  applied. Set to 0 to omit the badge number. This option is not  supported on Android. sound (optional) String. Name of the sound file  in the system.ResourceDirectory to be played when the scheduled  notification triggers. This sound is only played if the app is not  currently in the foreground. On iOS, there are limitations on the  kinds of sound that can be played (consult Apple’s documentation for  more details). custom (optional) Table. A table that will be delivered  with the notification event. This allows you to pass custom  information with the notification.

總之,現在沒有適當的方法來做到這一點.

翻譯自:https://stackoverflow.com/questions/39431350/corona-sdk-display-multi-line-notification