ios - 向 UILocalNotification soundName 添加自定义声音

标签 ios uilocalnotification

我想做的是,允许用户录制音频然后将录制的音频用作警报声,我已经设法完成了录制部分,但无法将录制的音频设置为 UILocalNotification 声音。我用谷歌搜索了一段时间,我发现人们都说除非它在主包中,否则不可能使用自定义声音。但是有一个名为 AidaReminder 的应用程序可以满足我的要求,所以有人知道该怎么做吗?

最佳答案

根据 https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6 :

The sound files can be in the main bundle of the client app or in the Library/Sounds folder of the app’s data container.

(添加了强调和格式)

这实际上是我第一次注意到这一点,不确定情况是否一直如此,或者是否在最近的 iOS 版本中添加了这一点。

关于ios - 向 UILocalNotification soundName 添加自定义声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34132588/

相关文章:

objective-c - 从 iOS 在后台发送电子邮件

ios - 删除 iPhone OpenGraph SMS 消息需要按 "Tap to Load Preview"

ios - 调用presentLocalNotificationNow 时触发didReceiveLocalNotification

ios - 我什么时候安排本地通知

c# - 自定义控件绑定(bind)不起作用

ios - NSURLCache 不会清除 iOS8 中存储的响应

ios - 如何在来自推送通知的 URL 的 ImageView 中显示图像

ios - 在运行时隐藏通知操作按钮

ios - 为什么当我在 localNotification 中解包字符串数组时它返回 nil?

ios - UILocalNotification 将在应用程序终止时工作