onLoad() {
uni.getPushClientId({
success: (res) => {
console.log(res.cid);
},
fail(err) {
console.log(err)
}
})
},
报错:errMsg: "getPushClientId:fail uniPush is not enabled"
 
                                        
                                    
                                    - 发布:2024-03-17 22:09
- 更新:2024-03-18 08:59
- 阅读:1109
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 11 专业版
HBuilderX类型: 正式
HBuilderX版本号: 3.99
浏览器平台: Chrome
浏览器版本: 122.0.6261.129
项目创建方式: HBuilderX
操作步骤:
                                    
                                         
                                
                                                                                                预期结果:
                                    
                                    
                                        正常使用uniPush
                                     
                                
                                                                                                正常使用uniPush
实际结果:
                                    
                                    
                                        报错:errMsg: "getPushClientId:fail uniPush is not enabled"
                                     
                                
                                                            报错:errMsg: "getPushClientId:fail uniPush is not enabled"
 
                                                                    
                                                                套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
新创建的项目测试的,是可以的
1.开发者后台配置上推送,我看你配了  
- 在项目中创建云开发环境,关联上云环境
- 在manifest.json中配上你代码里unipush,我看你也配了
- 在代码中调用,看你也调用了
- 
检查下,appid都能对上不,然后云环境能对上不 <template> <view> </view> </template>
<script>
export default {
data() {
return {  
        };  
    },  
    onLoad() {  
        uni.getPushClientId({  
            success: (res) => {  
                console.log(res.cid);  
            },  
            fail(err) {  
                console.log(err)  
            }  
        })  
    },  
    methods: {  
    },  
};  </script>
 
             
             
             
			



 
            
造件师 (作者)
今天到办公室,又正常了,要么是电脑 要么是网络问题,我回家再排查一下,谢谢大佬,大佬辛苦了
2024-03-18 17:49