uniapp

app推送通知unipush

打包需要开通push模块权限

onLaunch: function() {
  // #ifdef APP-PLUS  
  const _handlePush = function(message) {  
    console.log(message);
    //跳转到某个指定的页面
    //uni.navigateTo({  
    //url: message.payload.pagePath  
    //});
  };
  //点击通知消息时执行的事件
  plus.push.addEventListener('click', _handlePush);  
  //收到透传消息时执行的事件
  plus.push.addEventListener('receive', _handlePush);  
  // #endif 
  console.log('App Launch')
}

447条评论

  • Chasidy Argenal

    Hello There. I found your blog using msn. This is a really smartly written article. I will make sure to bookmark it and come back to read more of your helpful information. Thank you for the post. I’ll definitely return.|

  • Leatrice Engelstad

    Heya this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!|

Leave a Reply

邮箱地址不会被公开。