【问题标题】:How To Use Apple's Notification Sounds for User Notifications Swift如何将 Apple 的通知声音用于用户通知 Swift
【发布时间】:2018-03-29 17:05:07
【问题描述】:

我想知道是否可以在用户通知上使用 Apple 的通知声音之一,而不是始终使用 UNNotificationSound.default() 来发出声音,或者让用户能够进入设置并选择一种声音。

【问题讨论】:

    标签: swift notifications system-sounds unusernotification


    【解决方案1】:

    不,您不能使用任何系统声音。可用的系统声音位于Library/Audio,但您只能使用来自Library/Sounds 的声音。

    但是,您仍然可以通过提供声音文件和使用init(named:) 进行初始化来提供用户可以选择的自定义声音。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      相关资源
      最近更新 更多