List of available sounds for iOS push notification

2019-01-26 03:10发布

问题:

I'm trying to change the sound for my push notifications, but I don't know what the names are to use. I want to use the "electronic" sound, but what do I put in the sound field in my payload? Is there a list of available sounds?

回答1:

As stated in the docs, you can specify "default" as the value for your "sound" key in the payload to play the default sound, or the name of a sound file in your app bundle to play that sound. You'll need to prepare the sound to make sure it's in a compatible format.



回答2:

The answer above may be wrong.

You CAN specify a built in sound, the problem I'm looking into is figuring out all the names.

This APNS Python code for example works:

APNSmessage = Message([u1.push_notification_token], sound="chime", alert=sender+" Private Messaged You: "+messagePushNotification, badge=u1.unread_badge_count, custom={'slug':slugChannel})

Notice that sound is set to chime and not default. This works for iOS 7 and above and don't see why not that it should work for iOS 8 as well.

When I first wrote this code I just took a wild guess and entered chime which low and behold worked.