1***@qq.com
1***@qq.com
  • 发布:2019-10-14 21:43
  • 更新:2022-04-02 16:42
  • 阅读:2220

5+APP 接收 uni-push 离线消息后怎么产生提示音

分类:5+ SDK

我做的是5+APP
在接收到unipush的离线消息后状态栏有更新了,但是没有声音
用户表示需要提示音
emmmm...
213老板也想要...
----------------------------------------割----------------------------------------

plus.push.addEventListener('receive', function(msg) {  
    // tipsPlay();  
    str = msg.title + '_' + msg.content + '_' + JSON.stringify(msg.payload);  
    plus.push.createMessage(str, "LocalMSG", {sound:"system"});   
    if (msg.aps) {  
        // Apple APNS message    
        console.log(1)  
    } else {  
        console.log(2)  
        //alert("接收到在线透传消息:");    
    }  
    var options = {  
        cover: false  
    };  
    if (msg.payload) {  
        if (typeof(msg.payload) == "string") {  
            var tc_content = msg.payload;  
            if (tc_content == 'message') {  
                var s = plus.audio.createPlayer("audio/tips.mp3");  
                // s.play();  
            }  
        }  
    }  
}, false)

按照论坛上的说法我做了一系列调整,最后发现只有打开了app才能产生作用
手机型号:小米Note 3

2019-10-14 21:43 负责人:无 分享
已邀请:
6***@qq.com

6***@qq.com - 蜀邻科技

我还是遇到这个问题

maozai

maozai - 小程序开发者

同问

我是菜鸟sww

我是菜鸟sww - 就啊睡觉的

同问

该问题目前已经被锁定, 无法添加新回复