Andrea Castello
Andrea Castello

Reputation: 117

How to play the default ringtone in flutter?

I'm trying to play ringtones (and specifically a device's default one) with Flutter. It seems there isn't an flutter internal way to do it so I'm trying to use the audioplayer plugin, using this code:

AudioPlayer audioPlugin = new AudioPlayer();
audioPlugin.play('ringtone-uri');

The issue with this is:

   DEFAULT_RINGTONE_URI ?

I would like to avoid using channels with native code as much as possible.

Upvotes: 3

Views: 5444

Answers (1)

Kelvin
Kelvin

Reputation: 530

I don't know if it is late already but this might help somebody in future.

There are some packages you can download from pub.dev to get you the default ringtone of the phone, you can check this out flutter ringtone player

Upvotes: 3

Related Questions