简体   繁体   中英

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. So the question is: Are the tones in whatsapp and telegram are system sounds? 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:

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.

The notification sounds are located inside the app bundle. You *could* just unzip and explore the .ipa of the apps you mentioned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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