添加持续响铃示例

This commit is contained in:
Fin 2024-08-15 15:32:19 +08:00
parent 77606f0b94
commit c18403e845
4 changed files with 82 additions and 70 deletions

View File

@ -176,3 +176,6 @@ customSounds = "Custom Sounds";
defaultSounds = "Default Sounds";
uploadSoundNoticeFullText = "Please convert the sound file to caf format, and make sure it's no longer than 30 seconds.";
uploadSoundNoticeHighlightText = "convert the sound file to caf format";
ringtone = "Ringtone";
ringtoneNotice = "Ringtone for a notification";

View File

@ -176,3 +176,6 @@ customSounds = "Custom Sounds";
defaultSounds = "Default Sounds";
uploadSoundNoticeFullText = "Please convert the sound file to caf format, and make sure it's no longer than 30 seconds.";
uploadSoundNoticeHighlightText = "convert the sound file to caf format";
ringtone = "Ringtone";
ringtoneNotice = "Ringtone for a notification";

View File

@ -176,3 +176,6 @@ customSounds = "自定义铃声";
defaultSounds = "默认铃声";
uploadSoundNoticeFullText = "请先将铃声转换成 caf 格式,时长不超过 30 秒。";
uploadSoundNoticeHighlightText = "转换成 caf 格式";
ringtone = "持续响铃";
ringtoneNotice = "通知铃声将重复播放 30 秒,同时收到多个通知时将按顺序依次响铃。";

View File

@ -39,8 +39,7 @@ class HomeViewModel: ViewModel, ViewModelType {
let registerForRemoteNotifications: Driver<Void>
}
let previews: [PreviewModel] = {
[
let previews: [PreviewModel] = [
PreviewModel(
body: NSLocalizedString("CustomedNotificationContent"),
notice: NSLocalizedString("Notice1")
@ -57,6 +56,11 @@ class HomeViewModel: ViewModel, ViewModelType {
moreInfo: NSLocalizedString("viewAllSounds"),
moreViewModel: SoundsViewModel()
),
PreviewModel(
body: NSLocalizedString("ringtone"),
notice: NSLocalizedString("ringtoneNotice"),
queryParameter: "call=1"
),
PreviewModel(
body: NSLocalizedString("archiveNotificationMessageTitle"),
notice: NSLocalizedString("archiveNotificationMessage"),
@ -108,7 +112,6 @@ class HomeViewModel: ViewModel, ViewModelType {
queryParameter: "autoCopy=1&copy=optional"
)
]
}()
func transform(input: Input) -> Output {
let title = BehaviorRelay(value: URL(string: ServerManager.shared.currentServer.address)?.host ?? "")