Flutter_local_notifications: Using a device's sound on Android

Created on 28 Jun 2019  路  2Comments  路  Source: MaikuB/flutter_local_notifications

Is it possible to use sound/ringtone that is already available on the device? Looking at the example and some code, it appears that it's only possible to play a sound that is provided in the resources. I think it should be possible to provide a URI to play a sound that's already on the device. The URIs can be obtained with RingtoneManager.

Most helpful comment

As you may have noticed already when looking at the code, it's not possible to do so with the plugin. That would likely involve querying all of the available ringtones that IMO is outside the scope of the functionality of the plugin. If you need that functionality to look at forking or write platform-specific code to do so in your app. I could, however, look at making changes that would accept a URI for the sound.

All 2 comments

As you may have noticed already when looking at the code, it's not possible to do so with the plugin. That would likely involve querying all of the available ringtones that IMO is outside the scope of the functionality of the plugin. If you need that functionality to look at forking or write platform-specific code to do so in your app. I could, however, look at making changes that would accept a URI for the sound.

Support for passing in a URI has been in added in 1.4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prolongservices picture prolongservices  路  4Comments

nonComBen picture nonComBen  路  4Comments

carlleeswanson picture carlleeswanson  路  8Comments

iampawan picture iampawan  路  8Comments

dyhwang picture dyhwang  路  5Comments