You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/client/w2a/app.js

44 lines
888 B
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

App({
options: {
debug: true,
},
/**
* 当wap2app初始化完成时会触发 onLaunch
*/
onLaunch: function () {
console.log('launch');
uni.onPushMessage((res) => {
console.log('收到推送消息:', res); //监听推送消息
});
uni.getPushClientId({
success: (res) => {
let push_clientid = res.cid;
console.log('客户端推送标识:', push_clientid);
},
fail(err) {
console.log(err);
},
});
},
/**
* 当wap2app启动或从后台进入前台显示会触发 onShow
*/
onShow: function () {
console.log('show');
},
/**
* 当wap2app从前台进入后台会触发 onHide
*/
onHide: function () {
console.log('hide');
},
});
Page('__W2A__nightly.paw.msgbyte.com', {
//首页扩展配置
onShow: function () {},
onClose: function () {},
});