我正在使用cordova-plugin-local-notifications插件。现在我有问题要把我的声音文件在安卓和iOS。
window.plugin.notification.local.add({
id: '0001',
date: new Date,
message: 'hello',
title: 'title',
badge: 1,
sound: 'www/resources/audio/beep.mp3',
autoCancel: true,
ongoing: true
});我需要做的事,我需要改变在本土方面,我的应用程序在感官触摸。
发布于 2015-07-16 06:48:57
我认为插件已经更新,"window.plugin.notification.local.add"方法现在不再受欢迎,现在是"window.plugin.notification.local.schedule","date“现在是"at”,"message“现在是"text”。
要安装插件,请使用以下命令:
cordova plugin add de.appplant.cordova.plugin.local-notification && cordova prepare我已经安装了一个插件版本: 0.8.1,之前它是0.7.4在我的末尾。
将“声音”设置如下:
sound: "file://resources/audio/beep.mp3"所以您的新方法如下所示:
window.plugin.notification.local.schedule({
id: '0001',
at: new Date,
text: 'hello',
title: 'title',
badge: 1,
sound: 'file://resources/audio/beep.mp3',
autoCancel: true,
ongoing: true
});在iOS和安卓设备上,它对我来说很好。希望它能对你有所帮助
https://stackoverflow.com/questions/31341856
复制相似问题