不工作在iOS和Andorid的科尔多瓦当地的通知声音 [英] cordova local notification sound not working in ios and andorid

查看:182
本文介绍了不工作在iOS和Andorid的科尔多瓦当地的通知声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 https://github.com/katzer/cordova-plugin-local -notifications 插入。现在我有问题,让我的声音文件在Android和iOS的。 请,如果你有一个解决方案,请让我知道。

I have used https://github.com/katzer/cordova-plugin-local-notifications plugin. Now I have issue to get my sound file in both android and iOS. please if you have a solution, please let me know.

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

我需要做的,我需要在本机端改变煎茶触摸我的应用程序。

what I need to do I need to change in native side my app in sencha touch.

推荐答案

我觉得插件更新,window.plugin.notification.local.add方法是德$ P $现在pcated,现在是window.plugin.notification.local.schedule,约会现在是在和消息是现在的文。

I think the plugin is updated and the "window.plugin.notification.local.add" method is deprecated now, now it is "window.plugin.notification.local.schedule", the "date" is now "at" and "message" is now "text".

要安装下面的命令插件的使用:

To install plugin use below command:

cordova plugin add de.appplant.cordova.plugin.local-notification && cordova prepare

我已经安装的插件版本:0.8.1,它是0.7.4在我结束之前

I have plugin version installed: 0.8.1, before it is 0.7.4 at my end.

设置声音像如下:

sound: "file://resources/audio/beep.mp3"

让你的新方法是象下面这样:

so your new method will be like below:

window.plugin.notification.local.add({
    id:         '0001',   
    at:       new Date,      
    text:    'hello',
    title:      'title,  
    badge:      1,
    sound:      'file://resources/audio/beep.mp3', 
    autoCancel: true, 
    ongoing:    true 
});

这是工作的罚款,我在iOS和Android设备。 希望这将是对你有所帮助:)

It is working fine for me on iOS and Android devices. Hope it will be helpful to you :)

这篇关于不工作在iOS和Andorid的科尔多瓦当地的通知声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆