2***@qq.com
2***@qq.com
  • 发布:2017-12-11 14:58
  • 更新:2017-12-11 16:11
  • 阅读:1609

请问个推消息透传图标怎么修改?

分类:HTML5+

下拉栏中的消息图标,在安卓上是我应用的图标。为什么在IOS上是Hbuilder的图标?

2017-12-11 14:58 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com (作者) - 技术宅

是打包后的程序不是真机调试

2***@qq.com

2***@qq.com (作者) - 技术宅

//程序运行时设置消息中心不显示消息,recive接收  
            plus.push.setAutoNotification(false);  
            //从前台切到后台  
            document.addEventListener('pause',function(){  
                plus.push.setAutoNotification(true)  
            });  
            //从后台切换到前台 .这时收到透传消息会进入receive监听内  
            document.addEventListener('resume',function(){  
                plus.push.setAutoNotification(false)  
            });  
            console.log(plus.push.getClientInfo().clientid);  
            alert(plus.push.getClientInfo().clientid);  
            message = document.getElementById("message");  
            // 监听点击消息事件  
            plus.push.addEventListener( "click", function( msg ) {  
                // 判断是从本地创建还是离线推送的消息  
                switch( msg.payload ) {  
                    case "LocalMSG":  
                        //前台运行时监听在线消息,触发的,这里执行想执行的方法  
                        alert( "点击本地创建消息启动:" );  
                    break;  
                    default:  
                        //后台运行时走这里,这里执行想执行的方法  
                        alert( "点击离线推送消息启动:");  
                    break;  
                }  
                // 提示点击的内容  
                plus.ui.alert( msg.content );  
                // 处理其它数据  
//                logoutPushMsg( msg );  
            }, false );  
            // 监听在线消息事件  
            plus.push.addEventListener( "receive", function( msg ) {  
                if ( msg.aps ) {  // Apple APNS message  
                  console.log( "接收到在线APNS消息:" );  
                  var options = {cover:false};  
                    plus.push.createMessage( "接收到在线APNS消息:", "LocalMSG", options );  
                } else {  
                  console.log( "接收到在线透传消息:" );  
                  var options = {cover:false};  
                  plus.push.createMessage( "接收到在线透传消息:", "LocalMSG", options );  
                }  
            }, false );  
        });
骁骑

骁骑

用新版的HBuilder上传一张1024的图片,然后把所有的图标重新生成替换一遍再重新打包试试
(新版下载地址:Win版本:http://update.dcloud.net.cn/alpha/HBuilder.windows@20171211.zip
Mac版本:http://update.dcloud.net.cn/alpha/HBuilder.macosx_64@20171211.tar.gz )

  • 2***@qq.com (作者)

    好的,还有一个问题click事件为什么会触发两次?是有什么控制吗?

    2017-12-11 16:29

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