zoukankan      html  css  js  c++  java
  • uniapp原生sdk插件·极光官方合作发布·极光统计插件·极光统计Janalytics统计sdk

    本插件下载地址:

    https://ext.dcloud.net.cn/plugin?id=4750

    极光·Janalytics极光统计插件

    极光官方合作发布·极光统计插件·极光统计Janalytics统计sdk

    极光统计插件使用该插件的时候,请配合使用 JCore 基础插件包 ,JCore基础插件包地址:

    https://ext.dcloud.net.cn/plugin?id=4752

    使用方法:

    打包的时候勾选云插件

    调用方法:

    
    <template>
        <view>
            <view class="uni-padding-wrap uni-common-mt">   
    		
    		
    		
    						 <button  @tap="initCrashHandler()">initCrashHandler</button> 
    				          <button  @tap="stopCrashHandler()">stopCrashHandler</button> 	
    						 <button  @tap="setChannel()">setChannel</button> 
    		 
    		 <button  @tap="onCountEvent()">onCountEvent</button>
    		  <button  @tap="onCalculateEvent()">onCalculateEvent</button> 	
    		 <button  @tap="onLoginEvent()">onLoginEvent</button> 
    		 <button  @tap="onRegisterEvent()">onRegisterEvent</button>
    		  <button  @tap="onBrowseEvent()">onBrowseEvent</button> 	
    		 <button  @tap="onPurchaseEvent()">onPurchaseEvent</button> 
    		 
    		 
    		  <button  @tap="setAnalyticsReportPeriod()">setAnalyticsReportPeriod</button> 
    		 
    		 
    				 				 
    								 
    								 
    						   
            </view>
        </view>
    </template>
    
    <script>
    	const Janalytics = uni.requireNativePlugin('youyacao-Janalytics');
    	export default {
    		data() {
    			return {
    				title: 'Hello'
    			}
    		},
    		onLoad() {
    
    		},
    		methods: {
    			
    			setAnalyticsReportPeriod()
    			{
    				Janalytics.setAnalyticsReportPeriod({ 
    					period:10   //上报周期 10秒
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			initCrashHandler()
    			{
    				Janalytics.initCrashHandler({ }, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			stopCrashHandler()
    			{
    				Janalytics.stopCrashHandler({ }, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			setChannel()
    			{
    				Janalytics.setChannel({ 
    					channel:"channel"
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onCountEvent()
    			{
    				Janalytics.onCountEvent({ 
    					eventId:"wwww",
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onCalculateEvent()
    			{
    				Janalytics.onCalculateEvent({
    					eventId:"qqqq",
    					eventValue:1,
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onLoginEvent()
    			{
    				Janalytics.onLoginEvent({
    					loginMethod:"qq",
    					loginSuccess:true,
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onRegisterEvent()
    			{
    				Janalytics.onRegisterEvent({
    					registerMethod:"sina",
    					registerSuccess:true,
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    					
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onBrowseEvent()
    			{
    				Janalytics.onBrowseEvent({ 
    					browseId:"browse_id",
    					browseName:"深圳热点新闻",
    					browseType:"news",
    					browseDuration:30, 					//秒
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    			onPurchaseEvent()
    			{
    				 
    				Janalytics.onPurchaseEvent({ 
    					purchaseGoodsid:"goodsId",
    					purchaseGoodsName:"篮球",
    					purchasePrice:300     ,//
    					purchaseSuccess:true,
    					purchaseCurrency:"CNY"   ,    //  CNY   USD
    					purchaseGoodsType:"sport",
    					purchaseGoodsCount:1,
    					eventObj:[
    						{"objname1":"objvalue1"},
    						{"objname2":"objvalue2"}
    					]
    				}, result => {
    					const msg = JSON.stringify(result);
    					uni.showModal({
    						content: msg,
    						showCancel: false
    					}); 
    				}); 
    			},
    		}
    	}
    </script>
    
    <style>
    	.content {
    		display: flex;
    		flex-direction: column;
    		align-items: center;
    		justify-content: center;
    	}
    
    	.logo {
    		height: 200upx;
    		width: 200upx;
    		margin-top: 200upx;
    		margin-left: auto;
    		margin-right: auto;
    		margin-bottom: 50upx;
    	}
    
    	.text-area {
    		display: flex;
    		justify-content: center;
    	}
    
    	.title {
    		font-size: 36upx;
    		color: #8f8f94;
    	}
    </style>
    
    
  • 相关阅读:
    Android两级嵌套ListView滑动问题的解决
    关于Android适配华为等带有底部虚拟按键的解决方案
    更加成熟的领导力素质和学习敏感度
    完美解决ScollView内嵌ListView的问题
    Gson序列化问题导致的内存溢出,tip:Background sticky concurrent mark sweep GC freed
    从功能实现到实现设计
    iOS面试题汇总
    2017计算机专业大学排名
    Buffer.from()
    Buffer.isBuffer()详解
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/15229771.html
Copyright © 2011-2022 走看看