对接消息推送
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<script setup>
|
||||
import { onLaunch } from '@dcloudio/uni-app'
|
||||
|
||||
|
||||
// 应用启动时执行
|
||||
onLaunch(() => {
|
||||
console.log('App 启动')
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 只有 App 平台才获取 CID
|
||||
getPushCID()
|
||||
// #endif
|
||||
console.log('App 启动')
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 只有 App 平台才获取 CID
|
||||
getPushCID()
|
||||
// #endif
|
||||
})
|
||||
|
||||
|
||||
// 获取 uniPush 2.0 CID
|
||||
function getPushCID() {
|
||||
uni.getPushClientId({
|
||||
@@ -20,29 +20,12 @@
|
||||
|
||||
// 存起来备用
|
||||
uni.setStorageSync('push_cid', res.cid)
|
||||
|
||||
// 弹出CID给你看
|
||||
// uni.showModal({
|
||||
// title: '你的CID',
|
||||
// content: res.cid
|
||||
// })
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('获取推送 CID 失败', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
// export default {
|
||||
// on
|
||||
// onShow: function() {
|
||||
// // console.log('App Show')
|
||||
// },
|
||||
// onHide: function() {
|
||||
// console.log('App Hide')
|
||||
// },
|
||||
|
||||
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -64,7 +47,7 @@
|
||||
/* line-height: 1.6 !important; */
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
/* button:after{
|
||||
border-radius: 50px;
|
||||
} */
|
||||
|
||||
Reference in New Issue
Block a user