TongZhangzt / cordova-plugin-native-ringtones

Cordova Plugin for getting the native ringtone list on Android/IOS devices.You can also use this plugin to play native ringtones and custom ringtones(stored in the www folder).
https://www.npmjs.com/package/cordova-plugin-native-ringtones
Apache License 2.0
8 stars 20 forks source link

device ringtone list is not matching with plugin array list... #8

Closed pragatiy closed 6 years ago

pragatiy commented 6 years ago

Is there any suggestion to find it out ?

TongZhangzt commented 6 years ago

@pragatiy There are three kinds of ringtones for Android: 'notification', 'alarm', 'ringtone', default 'notification'. For IOS, check the list here: https://github.com/TUNER88/iOSSystemSoundsLibrary

pragatiy commented 6 years ago

Thanks @TongZhangzt . now i got the list of notification ringtone in Android. is it possible to fetch the ringtones by plugin ?

TongZhangzt commented 6 years ago

@pragatiy I didn't try to fetch the ringtones, this plugin can only play and stop play the given ringtone. But if you have got the list of notification ringtone (URI list), I guess you could use cordova-plugin-file plugin to do that.

pragatiy commented 6 years ago

In ios its showing some additional ringtones which are not matching with the device notification ringtone . how to can get only those notification are there in the device.

TongZhangzt commented 6 years ago

@pragatiy You can build some filter function after you got the list

merjana commented 6 years ago

have same problem here, it does not show the ringtons

TongZhangzt commented 6 years ago

@merjana Android or IOS? For Android, you need to specify 'notification', 'alarm', 'ringtone'.

merjana commented 6 years ago

where to specify exactly ? i tried this.ringtones.getRingtone("alarm"); but it didn't work

TongZhangzt commented 6 years ago

@merjana at the third parameter of the function: cordova.plugins.NativeRingtones.getRingtone(function(success) { ringtones = success; }, function(err) { alert(err); }, "alarm");