docs.unity.cn
    Show / Hide Table of Contents

    HuaweiService.analytic

    HiAnalytics此类提供了获取Analytics Kit实例的方法

    描述 api 华为文档链接
    获取Analytics Kit实例 getInstance(Activity activity) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-0000001050707170
    获取Analytics Kit实例 getInstance(Context context) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-0000001050707170
    获取Analytics Kit实例。支持设置数据处理位置 getInstance(Context context, String routePolicy) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-0000001050707170

    HiAnalyticsTools

    此类提供了打开调试日志的方法,以支持开发阶段的调试需求

    描述 api 华为文档链接
    打开调试日志,默认DEBUG级别 enableLog() https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-tools-0000001051067142
    打开调试日志,可自定义打印的最小日志级别 enableLog(int level) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-tools-0000001051067142

    HiAnalyticsInstance Analytics

    单例类,提供上报用户行为数据的公共方法

    描述 api 华为文档链接
    设置用户ID setUserId(String id) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    清除本地缓存的所有采集数据 clearCachedData() https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    记录事件 onEvent(String eventId, Bundle params) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    自定义退出页面事件 pageEnd(String pageName) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    自定义进入页面事件 pageStart(String pageName,String pageClassOverride) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    是否打开埋点采集能力 setAnalyticsEnabled(boolean enabled) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置重新开始新Session的最短时间间隔 setMinActivitySessions(long milliseconds) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置Push Token,通过Push Kit获取 setPushToken(String token) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置Session超时时长 setSessionDuration(long milliseconds) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置用户属性 setUserProfile(String name, String value) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    获取应用的匿名设备标识 getAAID() https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    获取自采集或者自定义的用户属性 getUserProfiles(boolean preDefined) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置自动上报的策略 setReportPolicies(Set[ReportPolicy](https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-reportpolicy-0000001058890134) policies) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置是否限制数据分析能力 setRestrictionEnabled(boolean isEnabled) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    获取当前分析开关的状态 isRestrictionEnabled() https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置是否开启采集广告标识符 setCollectAdsIdEnabled(boolean isEnabled) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置是否限制数据共享 setRestrictionShared(boolean shared) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    获取限制数据共享开关的状态 isRestrictionShared() https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    添加默认事件参数 addDefaultEventParams(Bundle params) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置微信openId setWXOpenId(String wxOpenId) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置微信unionId setWXUnionId(String wxUnionId) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    设置微信appId setWXAppId(String wxAppId) https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/android-api-hianalytics-instance-0000001050987219
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Monday, May 16, 2022