app center;增加發送ping的秒

This commit is contained in:
Caiyanpeng committed 2021-11-12 16:21:13 +08:00
1 parent 1bd1ffdb5a
commit d754ff3b15
719 files changed
+34172 -2875

No files matched your search

@@ -0,0 +1,120 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Analytics.Internal;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS || UNITY_ANDROID
using RawType = System.IntPtr;
#else
using RawType = System.Type;
#endif
public class Analytics
{
// Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension
public const string AnalyticsSDKVersion = "4.3.0";
public static void PrepareEventHandlers()
{
AnalyticsInternal.PrepareEventHandlers();
}
public static void AddNativeType(List<RawType> nativeTypes)
{
AnalyticsInternal.AddNativeType(nativeTypes);
}
public static void TrackEvent(string eventName)
{
AnalyticsInternal.TrackEvent(eventName);
}
public static void TrackEvent(string eventName, Flags flags)
{
AnalyticsInternal.TrackEvent(eventName, (int)flags);
}
public static void TrackEvent(string eventName, IDictionary<string, string> properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties);
}
}
public static void TrackEvent(string eventName, IDictionary<string, string> properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties, (int)flags);
}
}
public static void TrackEvent(string eventName, EventProperties properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties);
}
}
public static void TrackEvent(string eventName, EventProperties properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties, (int)flags);
}
}
public static AppCenterTask<bool> IsEnabledAsync()
{
return AnalyticsInternal.IsEnabledAsync();
}
public static AppCenterTask SetEnabledAsync(bool enabled)
{
return AnalyticsInternal.SetEnabledAsync(enabled);
}
public static TransmissionTarget GetTransmissionTarget(string transmissionTargetToken)
{
if (string.IsNullOrEmpty(transmissionTargetToken))
{
return null;
}
bool success;
var internalObject = AnalyticsInternal.GetTransmissionTarget(transmissionTargetToken, out success);
return success ? new TransmissionTarget(internalObject) : null;
}
public static void Pause()
{
AnalyticsInternal.Pause();
}
public static void Resume()
{
AnalyticsInternal.Resume();
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fd0e9bac2bb4245b3b6cd71e07030c30
timeCreated: 1497463739
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,64 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Analytics.Internal;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
using RawType = Dictionary<string, string>;
#else
using RawType = System.Object;
#endif
public class EventProperties
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public EventProperties()
{
_rawObject = EventPropertiesInternal.Create();
}
public EventProperties Set(string key, string val)
{
EventPropertiesInternal.SetString(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, DateTime val)
{
EventPropertiesInternal.SetDate(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, long val)
{
EventPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, double val)
{
EventPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, bool val)
{
EventPropertiesInternal.SetBool(_rawObject, key, val);
return this;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 004bef03efe4b5e498ec3de493d64e96
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
namespace Microsoft.AppCenter.Unity.Analytics
{
/// <summary>
/// Persistence and latency flags for telemetry.
/// </summary>
[Flags]
public enum Flags
{
/// <summary>
/// An event can be lost due to low bandwidth or disk space constraints.
/// </summary>
PersistenceNormal = 0x01,
/// <summary>
/// Used for events that should be prioritized over non-critical events.
/// </summary>
PersistenceCritical = 0x02
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2beeb33194756f94ea1a4d58e51de1b9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
public class PropertyConfigurator
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public PropertyConfigurator(RawType rawObject)
{
_rawObject = rawObject;
}
public void SetAppName(string appName)
{
PropertyConfiguratorInternal.SetAppName(_rawObject, appName);
}
public void SetAppVersion(string appVersion)
{
PropertyConfiguratorInternal.SetAppVersion(_rawObject, appVersion);
}
public void SetAppLocale(string appLocale)
{
PropertyConfiguratorInternal.SetAppLocale(_rawObject, appLocale);
}
public void SetEventProperty(string key, string value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, DateTime value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, long value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, double value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, bool value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetUserId(string userId)
{
PropertyConfiguratorInternal.SetUserId(_rawObject, userId);
}
public void RemoveEventProperty(string key)
{
PropertyConfiguratorInternal.RemoveEventProperty(_rawObject, key);
}
public void CollectDeviceId()
{
PropertyConfiguratorInternal.CollectDeviceId(_rawObject);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 55fb0e0927ff24e679c9231f38c6d0ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,126 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
public class TransmissionTarget
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public TransmissionTarget(RawType rawObject)
{
_rawObject = rawObject;
}
public void TrackEvent(string eventName)
{
TransmissionTargetInternal.TrackEvent(_rawObject, eventName);
}
public void TrackEvent(string eventName, Flags flags)
{
TransmissionTargetInternal.TrackEvent(_rawObject, eventName, (int)flags);
}
public void TrackEvent(string eventName, IDictionary<string, string> properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties);
}
}
public void TrackEvent(string eventName, IDictionary<string, string> properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties, (int)flags);
}
}
public void TrackEvent(string eventName, EventProperties properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties);
}
}
public void TrackEvent(string eventName, EventProperties properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties, (int)flags);
}
}
public AppCenterTask<bool> IsEnabledAsync()
{
return TransmissionTargetInternal.IsEnabledAsync(_rawObject);
}
public AppCenterTask SetEnabledAsync(bool enabled)
{
return TransmissionTargetInternal.SetEnabledAsync(_rawObject, enabled);
}
public TransmissionTarget GetTransmissionTarget(string childTransmissionTargetToken)
{
if (string.IsNullOrEmpty(childTransmissionTargetToken))
{
return null;
}
bool success;
var internalObject = TransmissionTargetInternal.GetTransmissionTarget(_rawObject, childTransmissionTargetToken, out success);
return success ? new TransmissionTarget(internalObject) : null;
}
public PropertyConfigurator GetPropertyConfigurator()
{
return new PropertyConfigurator(TransmissionTargetInternal.GetPropertyConfigurator(_rawObject));
}
public void Pause()
{
TransmissionTargetInternal.Pause(_rawObject);
}
public void Resume()
{
TransmissionTargetInternal.Resume(_rawObject);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 713452dbc18f44e7da0005d414778b9a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: