当前位置:网站首页>Uni app message push

Uni app message push

2022-04-23 14:16:00 Ruirui junior

 

1. Sign in first :https://dev.dcloud.net.cn/app/index?type=0

 

 2. The next step is important , Ah , For a long time , To the back cid It's useful to get . Remember to have these things .

 

 3. Create a uni-app project , To configure manifest.json, Here we use the above things

 4.CID Acquisition , Attention is to let cid Display in the client , Then save the obtained value , Behind the useful

Code display :

<script>
    export default {
        data() {
            return {
                title: 'Hello'
            }
        },
        onLoad() {
                this.getcid()
        },
        methods: {        
            getcid(){
                setInterval(function(){
                    uni.showToast({
                        icon:"success",
                        position:"center",
                        title:plus.push.getClientInfo().clientid
                    })
                },2000)
            }
        }
    }
</script>

5.

6. 

7, Cloud packaging , Choose the first one , Native app Cloud packaging , The package name inside is consistent with that configured in the background , May choose dcloud Public certificate .

 8, After successful packing , Pay attention to the console , You can download it later apk The address of , Install on your phone , Because the client code has been written cid Acquisition , So you can see on your mobile phone cid 了 , Pay attention , Is to get... On your mobile phone , Of course, the simulator can also , The browser won't work , Put this cid Write it down , When sending message preview, you will use

9 You can send messages , The mobile notification bar can see , ha-ha

 

 

 

版权声明
本文为[Ruirui junior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231408339424.html