Skip to main content

Native Ringtones

The plugin helps get the native ringtones list on Android or IOS devices. And you can also use this plugin to play or stop the native ringtones and custom ringtones(added in the www folder).

https://github.com/TongZhangzt/cordova-plugin-native-ringtones

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation#

$ npm install cordova-plugin-native-ringtones
$ npm install @ionic-native/native-ringtones
$ ionic cap sync

Supported Platforms#

  • Android
  • iOS

Usage#

React#

Learn more about using Ionic Native components in React

Angular#

import { NativeRingtones } from '@ionic-native/native-ringtones/ngx';
constructor(private ringtones: NativeRingtones) { }
...
this.ringtones.getRingtone().then((ringtones) => { console.log(ringtones); });
this.ringtones.playRingtone('assets/ringtones/sound_1.caf');
this.ringtones.stopRingtone('assets/ringtones/sound_1.caf');