#nullable enable using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Uniject; using UnityEngine.Purchasing.Telemetry; namespace UnityEngine.Purchasing { class MetricizedAppleStoreImpl : AppleStoreImpl { readonly ITelemetryMetricsService m_TelemetryMetricsService; public MetricizedAppleStoreImpl(IUtil util, ITelemetryDiagnostics telemetryDiagnostics, ITelemetryMetricsService telemetryMetricsService) : base(util, telemetryDiagnostics) { m_TelemetryMetricsService = telemetryMetricsService; } public override void FetchStorePromotionOrder(Action> successCallback, Action errorCallback) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.FetchStorePromotionOrder(successCallback, errorCallback), TelemetryMetricDefinitions.fetchStorePromotionOrderName); } public override void FetchStorePromotionVisibility(Product product, Action successCallback, Action errorCallback) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.FetchStorePromotionVisibility(product, successCallback, errorCallback), TelemetryMetricDefinitions.fetchStorePromotionVisibilityName); } public override void SetStorePromotionOrder(List products) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.SetStorePromotionOrder(products), TelemetryMetricDefinitions.setStorePromotionOrderName); } [Obsolete("RestoreTransactions(Action callback) is deprecated, please use RestoreTransactions(Action callback) instead.")] public override void RestoreTransactions(Action? callback) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.RestoreTransactions(callback), TelemetryMetricDefinitions.restoreTransactionName); } public override void RestoreTransactions(Action? callback) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.RestoreTransactions(callback), TelemetryMetricDefinitions.restoreTransactionName); } public override void RefreshAppReceipt(Action successCallback, Action errorCallback) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.RefreshAppReceipt(successCallback, errorCallback), TelemetryMetricDefinitions.refreshAppReceiptName); } public override void ContinuePromotionalPurchases() { m_TelemetryMetricsService.ExecuteTimedAction( base.ContinuePromotionalPurchases, TelemetryMetricDefinitions.continuePromotionalPurchasesName); } public override void PresentCodeRedemptionSheet() { m_TelemetryMetricsService.ExecuteTimedAction( base.PresentCodeRedemptionSheet, TelemetryMetricDefinitions.presentCodeRedemptionSheetName); } public override void RetrieveProducts(ReadOnlyCollection products) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.RetrieveProducts(products), TelemetryMetricDefinitions.retrieveProductsName); } public override void Purchase(ProductDefinition product, string developerPayload) { m_TelemetryMetricsService.ExecuteTimedAction( () => base.Purchase(product, developerPayload), TelemetryMetricDefinitions.initPurchaseName); } } }