Skip to content

自定义 iOS 通知提示音

本文介绍了如何实现 自定义 iOS 通知提示音.

  1. 添加音频文件到 Xcode 项目 picture 0
  2. 设置通知提示音
    swift
     let content = UNMutableNotificationContent()
     content.title = title
     content.body = body
     content.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "ra2-warning-zi-zi.wav"))