简体   繁体   English

本地通知中的不同音调

[英]Different tones in local notifications

I am developing a chat app. 我正在开发一个聊天应用程序。 And of course, local notification is of great importance in such applications. 当然,本地通知在此类应用程序中非常重要。 So, I decided to take a look at the other chat apps to get an idea. 因此,我决定看看其他聊天应用程序以了解一个想法。 Surprisingly, I found that WhatsApp and telegram have so much common alert tones. 令人惊讶的是,我发现WhatsApp和电报具有如此多的常见提示音。 So the question is: Are the tones in whatsapp and telegram are system sounds? 所以问题是:whatsapp和电报中的音调是系统声音吗? And if so, how to use them? 如果是这样,如何使用它们?

I did some search but found nothing regarding the topic! 我进行了一些搜索,但未找到与该主题相关的任何内容!

When you send a remote notification to a device you can specify a notification sound. 当您向设备发送远程通知时,您可以指定通知声音。

As per the Apple docs the sound key should contain a string with: 根据Apple文档, sound键应包含以下字符串:

The name of a sound file in the app bundle. 应用程序捆绑包中声音文件的名称。 The sound in this file is played as an alert. 该文件中的声音将作为警报播放。 If the sound file doesn't exist or default is specified as the value, the default alert sound is played. 如果声音文件不存在或将默认值指定为值,则播放默认警报声音。 The audio must be in one of the audio data formats that are compatible with system sounds; 音频必须采用与系统声音兼容的音频数据格式之一; see Preparing Custom Alert Sounds for details. 有关详细信息,请参见准备自定义警报声音

In case of a local notification you can set the property soundName to UILocalNotificationDefaultSoundName or any name of a sound file in the app bundle as well. 如果是本地通知,则可以将属性soundName设置为UILocalNotificationDefaultSoundName或在应用程序捆绑包中设置声音文件的任何名称。

The notification sounds are located inside the app bundle. 通知声音位于应用程序捆绑包内。 You *could* just unzip and explore the .ipa of the apps you mentioned. 您*可以*只需解压缩并浏览您提到的应用程序的.ipa

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM