3

Are ios native sounds Ringtone, Text Tone, New Mail, etc. available to play directly via Cordova (with the native audio plugin, for instance)?

All the examples I can find require a direct URL to the sound file in your www/audio directory, like this:

//preload the media 
window.plugins.NativeAudio.preloadComplex( 'music', 'audio/music.mp3', 1, 1, 0, function(msg){
}, function(msg){
        console.log( 'error: ' + msg )
});

window.plugins.NativeAudio.loop( 'music' );

Can't they be accessed and played directly? Let's say the iphone has Text Tone preference set to "Aurora." I'd want the app to be able to trigger the "Text Tone," which would play the sound "Aurora".

lilbiscuit
  • 2,109
  • 6
  • 32
  • 53
  • +1, I would love to have this answer, too. I haven't seen an ionic way of doing it. [This answer](https://stackoverflow.com/questions/7831671/playing-system-sound-without-importing-your-own) shows that it's possible for iOS apps to play system sounds, but I haven't found a plugin that allows access to that through ionic. – Pete May 21 '17 at 04:35

1 Answers1

1

You can access ringtones now via this plugin: cordova-plugin-native-ringtones.

lilbiscuit
  • 2,109
  • 6
  • 32
  • 53