Native Ringtones

Contents

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).

Installation

ionic cordova plugin add cordova-plugin-native-ringtonesnpm install @ionic-native/native-ringtones
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEYnpm install @ionic-enterprise/native-ringtones

Supported Platforms

  • Android
  • iOS

Usage

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');