List of available sounds for iOS push notifications

前端 未结 2 1560
挽巷
挽巷 2020-12-18 18:06

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 sou

相关标签:
2条回答
  • 2020-12-18 18:39

    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.

    0 讨论(0)
  • 2020-12-18 18:43

    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.

    0 讨论(0)
提交回复
热议问题