为了账号安全,请及时绑定邮箱和手机立即绑定

uniapp针对openinstall无法统计到注册量的问题解决方案及demo

标签:
Android Vue.js

uniapp针对openinstall无法统计到注册量的问题解决方案及demo

https://img1.sycdn.imooc.com//5eabf9dd00010c4203410643.jpg


这个是与openinstall官方成员一起解决掉的 bug问题,因为原生SDK插件支持带来的相关问题。


由于注册统计代码  放入非app.vue 全局文件而无法引入插件配置导致的问题。


这是最后解决方案。


template>
<view class="content">
<image class="logo" class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
<button v-on:click="testRegister">测试注册</button>
</view>
</template>

<script>
export default { 
data() {
return {
title: 'Hello'
}
},
onLoad() {

},
methods: {
testRegister:function(even){
console.log('button click')
const openinstall = uni.requireNativePlugin('openinstall-plugin');
openinstall.reportRegister();
}
},
};

</script>

<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}

.text-area {
display: flex;
justify-content: center;
}

.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>


代码片段






点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 1
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消