Skip to content

Commit 54e0a8b

Browse files
authored
feat: copy paste pex analytics (#5632)
1 parent cd21275 commit 54e0a8b

File tree

82 files changed

+366
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+366
-60
lines changed

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation.meta renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation.meta

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmation.asmdef renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmation.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"GUID:f51ebe6a0ceec4240a699833d6309b23",
2525
"GUID:a3ceb534947fac14da25035bc5c24788",
2626
"GUID:98bf3bf29030cbf4092d89a7cc28b7fb",
27-
"GUID:4d3366a36e77f41cfb7436340334e236"
27+
"GUID:4d3366a36e77f41cfb7436340334e236",
28+
"GUID:4da9df9a132541f2a0ce3fc6f0578851"
2829
],
2930
"includePlatforms": [],
3031
"excludePlatforms": [],

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmation.asmdef.meta renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmation.asmdef.meta

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPlugin.cs renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPlugin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using DCL.Helpers;
33
using DCL.Providers;
44
using DCL.World.PortableExperiences;
5+
using DCLServices.PortableExperiences.Analytics;
56
using System.Threading;
67

78
namespace DCL.PortableExperiences.Confirmation
@@ -26,7 +27,8 @@ private async UniTaskVoid Initialize(CancellationToken cancellationToken)
2627
popupController = new ExperiencesConfirmationPopupController(view,
2728
DataStore.i,
2829
new PlayerPrefsConfirmedExperiencesRepository(new DefaultPlayerPrefs()),
29-
new UserProfileWebInterfaceBridge());
30+
new UserProfileWebInterfaceBridge(),
31+
Environment.i.serviceLocator.Get<IPortableExperiencesAnalyticsService>());
3032
}
3133

3234
public void Dispose()

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPlugin.cs.meta renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPlugin.cs.meta

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPopupComponentView.cs renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPopupComponentView.cs

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPopupComponentView.cs.meta renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPopupComponentView.cs.meta

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPopupController.cs renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPopupController.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Cysharp.Threading.Tasks;
22
using DCL.Tasks;
33
using DCL.World.PortableExperiences;
4+
using DCLServices.PortableExperiences.Analytics;
45
using System;
56
using System.Collections.Generic;
67
using System.Threading;
@@ -21,6 +22,7 @@ private enum InputType
2122
private readonly DataStore dataStore;
2223
private readonly IConfirmedExperiencesRepository confirmedExperiencesRepository;
2324
private readonly IUserProfileBridge userProfileBridge;
25+
private readonly IPortableExperiencesAnalyticsService analytics;
2426
private readonly List<string> descriptionBuffer = new ();
2527

2628
private string experienceId;
@@ -31,12 +33,14 @@ private enum InputType
3133
public ExperiencesConfirmationPopupController(IExperiencesConfirmationPopupView view,
3234
DataStore dataStore,
3335
IConfirmedExperiencesRepository confirmedExperiencesRepository,
34-
IUserProfileBridge userProfileBridge)
36+
IUserProfileBridge userProfileBridge,
37+
IPortableExperiencesAnalyticsService analytics)
3538
{
3639
this.view = view;
3740
this.dataStore = dataStore;
3841
this.confirmedExperiencesRepository = confirmedExperiencesRepository;
3942
this.userProfileBridge = userProfileBridge;
43+
this.analytics = analytics;
4044

4145
view.Hide(true);
4246

@@ -79,13 +83,15 @@ async UniTaskVoid ShowAndWaitForUserInputThenHide(
7983

8084
view.Show();
8185

86+
bool isSmartWearable = userProfileBridge.GetOwn().avatar.wearables.Contains(pxId);
87+
8288
view.SetModel(new ExperiencesConfirmationViewModel
8389
{
8490
Name = metadata.ExperienceName,
8591
IconUrl = metadata.IconUrl,
8692
Permissions = descriptionBuffer,
8793
Description = metadata.Description,
88-
IsSmartWearable = userProfileBridge.GetOwn().avatar.wearables.Contains(pxId),
94+
IsSmartWearable = isSmartWearable,
8995
});
9096

9197
try
@@ -98,12 +104,16 @@ async UniTaskVoid ShowAndWaitForUserInputThenHide(
98104
if (dontShowAnymore)
99105
confirmedExperiencesRepository.Set(experienceId, true);
100106

107+
analytics.Accept(experienceId, dontShowAnymore, isSmartWearable ? "smart_wearable" : "scene");
108+
101109
confirmationData.OnAcceptCallback?.Invoke();
102110
break;
103111
case InputType.Reject:
104112
if (dontShowAnymore)
105113
confirmedExperiencesRepository.Set(experienceId, false);
106114

115+
analytics.Reject(experienceId, dontShowAnymore, isSmartWearable ? "smart_wearable" : "scene");
116+
107117
confirmationData.OnRejectCallback?.Invoke();
108118
break;
109119
case InputType.Cancel:

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationPopupController.cs.meta renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationPopupController.cs.meta

File renamed without changes.

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExperiencesConfirmation/ExperiencesConfirmationViewModel.cs renamed to unity-renderer/Assets/DCLPlugins/ExperiencesConfirmation/ExperiencesConfirmationViewModel.cs

File renamed without changes.

0 commit comments

Comments
 (0)