# Push - 推送

# 简介

Push为方便客户端使用UniPush,初始化并监听了消息接收事件、点击事件。更多使用详见UniPush使用指南 (opens new window)

App.vue中使用

<script>
import { Push } from '@anyup/uniui'
export default {
  onLaunch: function () {
    /* #ifdef APP-PLUS */
    new Push().register(payload => {
      setTimeout(() => {
        try {
          uni.navigateTo({ url: '/pages/message/message' })
        } catch (error) {
        }
      }, 500);
    })
    /* #endif */
  }
}
</script>

# 获取clientid

import { Plus } from '@anyup/uniui'
new Plus().clientid()