Beispiel #1
0
        /// <summary>
        /// 开启友盟统计
        /// </summary>
        /// <param name="appkey">友盟appKey</param>
        /// <param name="policy">发送策略</param>
        /// <param name="channelId">渠道名称</param>
        ///
        public static void StartWithAppKeyAndReportPolicyAndChannelId(string appkey, ReportPolicy policy, string channelId)
        {
#if UNITY_EDITOR
            //Debug.LogWarning("友盟统计在iOS/Androi 真机上才会向友盟后台服务器发送事件 请在真机上测试");
#else
            _StartWithAppKeyAndReportPolicyAndChannelId(appkey, (int)policy, channelId, version);
            _AppKey    = appkey;
            _ChannelId = channelId;
#endif
        }
Beispiel #2
0
        public override bool MoveTaskToBack(bool nonRoot)
        {
            //Report an event upon app startup.
            ReportPolicy appLaunchPolicy = ReportPolicy.OnAppLaunchPolicy;
            //Report an event at the specified interval.
            ReportPolicy scheduledTimePolice = ReportPolicy.OnScheduledTimePolicy;

            //Set the event reporting interval to 600 seconds.
            scheduledTimePolice.Threshold = (Java.Lang.Integer) 600;
            List <ReportPolicy> reportPolicies = new List <ReportPolicy>();

            //Add the OnAppLaunchPolicy and OnScheduledTimePolicy policies.
            reportPolicies.Add(scheduledTimePolice);
            reportPolicies.Add(appLaunchPolicy);
            //Set the OnAppLaunchPolicy and OnScheduledTimePolicy policies.
            instance.SetReportPolicies(reportPolicies);
            return(base.MoveTaskToBack(nonRoot));
        }
Beispiel #3
0
    /// <summary>
    /// 开启友盟统计
    /// </summary>
    /// <param name="appkey">友盟appKey</param>
    /// <param name="policy">发送策略</param>
    /// <param name="channelId">渠道名称</param>
    /// 
    public static void StartWithAppKeyAndReportPolicyAndChannelId(string appkey, ReportPolicy policy, string channelId)
    {
#if UNITY_EDITOR
        Debug.LogWarning("友盟统计在iOS/Androi 真机上才会向友盟后台服务器发送事件 请在真机上测试");
#else

        _StartWithAppKeyAndReportPolicyAndChannelId(appkey, (int)policy, channelId);
        _AppKey = appkey;
        _ChannelId = channelId;
#endif
    }