com.amanotes.gdk 0.2.35 → 0.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.36 - 2023-11-15]
4
+ - Add OnAdShowReadyStatus callback
5
+ - Revive AdEventTracking
6
+
3
7
  ## [0.2.35 - 2023-11-14]
4
8
  - [Fix] Save UserID
5
9
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -58,7 +58,15 @@ namespace Amanotes.Core
58
58
  return ad;
59
59
  }
60
60
 
61
- public static IAdCallback OnAdResult(this IAdCallback ad, Action<AdResult> callback)
61
+ public static IAdCallback OnAdShowReadyStatus(this IAdCallback ad, Action<AdShowReadyStatus> callback)
62
+ {
63
+ if (!MakeSureAdNotNull(ad)) return null;
64
+ Ads.context.onAdShowReadyStatus -= callback;
65
+ Ads.context.onAdShowReadyStatus += callback;
66
+ return ad;
67
+ }
68
+
69
+ public static IAdCallback OnAdResult(this IAdCallback ad, Action<bool> callback)
62
70
  {
63
71
  if (!MakeSureAdNotNull(ad)) return null;
64
72
  Ads.context.onResult -= callback;
@@ -82,10 +90,15 @@ namespace Amanotes.Core
82
90
  [Serializable]
83
91
  internal class AdStat
84
92
  {
85
- internal int lastSuccessTime;
93
+ // per session
94
+ internal float lastCallTime;
95
+ internal int callCount;
96
+
97
+ internal float lastSuccessTime;
86
98
  internal int success;
87
99
  internal int failed;
88
-
100
+
101
+ // persistent
89
102
  public int successTotal;
90
103
  public int failedTotal;
91
104
  }
@@ -96,11 +109,26 @@ namespace Amanotes.Core
96
109
  public AdStat interstitial = new AdStat();
97
110
  public AdStat reward = new AdStat();
98
111
 
99
- internal int TimeSinceLastShow(AdType adType)
112
+ internal AdStat GetStat(AdType adType)
113
+ {
114
+ return adType == AdType.Interstitial ? interstitial : reward;
115
+ }
116
+
117
+ internal int ShowCallCount(AdType adType)
118
+ {
119
+ return GetStat(adType).callCount;
120
+ }
121
+
122
+ internal int TimeSinceLastShowCalled(AdType adType)
100
123
  {
101
- return (int)(Time.realtimeSinceStartup - (adType == AdType.Interstitial ? interstitial.lastSuccessTime : reward.lastSuccessTime));
124
+ return (int)(Time.realtimeSinceStartup - GetStat(adType).lastCallTime);
102
125
  }
103
126
 
127
+ internal int TimeSinceLastShowSuccess(AdType adType)
128
+ {
129
+ return (int)(Time.realtimeSinceStartup - GetStat(adType).lastSuccessTime);
130
+ }
131
+
104
132
  internal void Save()
105
133
  {
106
134
  this.SaveJsonToFile();
@@ -110,12 +138,10 @@ namespace Amanotes.Core
110
138
  [Serializable]
111
139
  public class AdAdapterConfig
112
140
  {
113
- public bool autoInit;
141
+ // public bool manualInit;
114
142
  public int adLoadTimeoutInSecs = 60;
115
143
  public int adShowTimeoutInSecs = 5;
116
144
  public BannerPosition bannerPosition = BannerPosition.BOTTOM;
117
-
118
- public bool checkInternet = true;
119
145
  public bool autoLogEvent = true;
120
146
 
121
147
  public bool enableInterstitial = true;
@@ -252,12 +278,15 @@ namespace Amanotes.Core
252
278
  _adapter.rewardVideo.StopShowAd();
253
279
  }
254
280
 
255
- public static int TimeSinceLastInterstitial => localData.TimeSinceLastShow(AdType.Interstitial);
281
+ public static int TimeSinceLastInterstitialSucceed => localData.TimeSinceLastShowSuccess(AdType.Interstitial);
282
+ public static int TimeSinceLastVideoRewardSucceed => localData.TimeSinceLastShowSuccess(AdType.VideoReward);
283
+ public static int TimeSinceLastAdSucceed => Math.Min(TimeSinceLastInterstitialSucceed, TimeSinceLastVideoRewardSucceed) ;
284
+ public static int TimeSinceLastInterstitialShowCalled => localData.TimeSinceLastShowCalled(AdType.Interstitial);
285
+ public static int TimeSinceLastVideoRewardShowCalled => localData.TimeSinceLastShowCalled(AdType.VideoReward);
256
286
 
257
- public static int TimeSinceLastVideoReward => localData.TimeSinceLastShow(AdType.VideoReward);
287
+ public static int InterstitialShowCalledInSession => localData.ShowCallCount(AdType.Interstitial);
288
+ public static int RewardVideoShowCalledInSession => localData.ShowCallCount(AdType.VideoReward);
258
289
 
259
- public static int TimeSinceLastAd => Math.Min(TimeSinceLastInterstitial, TimeSinceLastVideoReward) ;
260
-
261
290
  public static void SetUserId(string userId)
262
291
  {
263
292
  _adapter.SetUserId(userId);
@@ -305,13 +334,15 @@ namespace Amanotes.Core.Internal
305
334
  public enum AdCallback
306
335
  {
307
336
  None = 0,
308
- Open = 1,
309
- Reward = 2,
310
- Click = 4,
311
- Cancel = 8,
312
- Close = 16,
313
- Success = 32,
314
- Fail = 64
337
+ ShowCalled = 1,
338
+ ShowReadyStatus = 2,
339
+ Open = 4,
340
+ Reward = 8,
341
+ Click = 16,
342
+ Cancel = 32,
343
+ Close = 64,
344
+ Success = 128,
345
+ Fail = 256
315
346
  }
316
347
 
317
348
  public enum BannerPosition
@@ -326,33 +357,30 @@ namespace Amanotes.Core.Internal
326
357
  VideoReward,
327
358
  Banner
328
359
  }
329
-
330
- public enum AdResult
360
+
361
+ public enum AdShowReadyStatus
331
362
  {
332
363
  None,
333
- Success,
334
- WifiAndCarrierDataDisable,
335
- NoInternetAccess,
336
- RequestTimeOut,
337
- AdapterReturnError
364
+ Wifi3GDisabled,
365
+ NoInternet,
366
+ TimeOut
338
367
  }
339
-
368
+
340
369
  public class ShowAdContext : IAdCallback
341
370
  {
342
371
  public readonly AdType adType;
343
372
  public readonly string placementName;
344
- public AdResult result = AdResult.None;
345
373
  public readonly Dictionary<string, object> userData;
346
374
  public AdCallback adCallback;
347
-
375
+
348
376
  internal Action onOpened;
349
377
  internal Action onRewardReceived;
350
378
  internal Action onClicked;
351
379
  internal Action onShowSuccess;
352
380
  internal Action onShowFailed;
353
381
  internal Action onClosed;
354
-
355
- internal Action<AdResult> onResult;
382
+ internal Action<AdShowReadyStatus> onAdShowReadyStatus;
383
+ internal Action<bool> onResult;
356
384
 
357
385
  // Stats
358
386
  public float showCallAt;
@@ -442,12 +470,12 @@ namespace Amanotes.Core.Internal
442
470
  continue;
443
471
  }
444
472
 
445
- if (Ads._adConfig.checkInternet && !HasLocalNetworkConnection)
473
+ if (!HasLocalNetworkConnection)
446
474
  {
447
475
  Log("[Ad] LoadAdRoutine: hasInternet = " + HasLocalNetworkConnection);
448
476
  continue;
449
477
  }
450
-
478
+
451
479
  _loadState = LoadAdsState.Requesting;
452
480
  _isRequesting = true;
453
481
  Log("[Ad] LoadAdRoutine: RequestAd()");
@@ -505,6 +533,12 @@ namespace Amanotes.Core.Internal
505
533
 
506
534
  Log($"[Ad] {adType} StartShowAd");
507
535
  _showState = ShowAdsState.ShowCalled;
536
+
537
+ AdStat stat = Ads.localData.GetStat(adType);
538
+ stat.callCount++;
539
+ stat.lastCallTime = Time.realtimeSinceStartup;
540
+ OnAdShowCalled();
541
+
508
542
  if (_showAdRoutine != null) _instance.StopCoroutine(_showAdRoutine);
509
543
  _showAdRoutine = _instance.StartCoroutine(ShowAdRoutine());
510
544
  }
@@ -518,6 +552,7 @@ namespace Amanotes.Core.Internal
518
552
  _loadState = LoadAdsState.None;
519
553
  StartLoadAd();
520
554
  }
555
+
521
556
  HandleAfterAdShow();
522
557
  if (_showAdRoutine == null) return;
523
558
  _instance.StopCoroutine(_showAdRoutine);
@@ -546,31 +581,27 @@ namespace Amanotes.Core.Internal
546
581
  LogWarning("[Ad] Inconsistent state report: isAdReady == false while _loadState == Ready");
547
582
  _loadState = LoadAdsState.None;
548
583
  }
584
+
585
+ if (!HasLocalNetworkConnection)
586
+ {
587
+ _showState = ShowAdsState.ShowFail;
588
+ OnAdShowReadyStatus(false, AdShowReadyStatus.Wifi3GDisabled);
589
+ ShowAdRoutineCompleted(false);
590
+ yield break;
591
+ }
549
592
 
550
- if (Ads._adConfig.checkInternet)
593
+ var hasInternet = false;
594
+ yield return WebUtils.CheckInternet(result => hasInternet = result);
595
+ if (!hasInternet)
551
596
  {
552
- if (!HasLocalNetworkConnection)
553
- {
554
- _showState = ShowAdsState.ShowFail;
555
- Ads.context.result = AdResult.WifiAndCarrierDataDisable;
556
- ShowAdRoutineCompleted(false);
557
- yield break;
558
- }
559
-
560
- var hasInternet = false;
561
- yield return WebUtils.CheckInternet(result => hasInternet = result);
562
- if (!hasInternet)
563
- {
564
- _showState = ShowAdsState.ShowFail;
565
- Ads.context.result = AdResult.NoInternetAccess;
566
- ShowAdRoutineCompleted(false);
567
- yield break;
568
- }
597
+ _showState = ShowAdsState.ShowFail;
598
+ OnAdShowReadyStatus(false, AdShowReadyStatus.NoInternet);
599
+ ShowAdRoutineCompleted(false);
600
+ yield break;
569
601
  }
570
602
 
571
603
  if (_loadState != LoadAdsState.Requesting) StartLoadAd();
572
604
  _showState = ShowAdsState.WaitForAd;
573
-
574
605
  int timeout = Ads._adConfig.adShowTimeoutInSecs;
575
606
  var counter = 0;
576
607
 
@@ -583,14 +614,15 @@ namespace Amanotes.Core.Internal
583
614
 
584
615
  if (!isAdReady)
585
616
  {
586
- Ads.context.result = AdResult.RequestTimeOut;
617
+ OnAdShowReadyStatus(false, AdShowReadyStatus.TimeOut);
587
618
  ShowAdRoutineCompleted(false);
588
619
  yield break;
589
620
  }
590
621
  }
591
622
 
592
623
  _showState = ShowAdsState.Showing;
593
- // Ad should be ready here!
624
+ OnAdShowReadyStatus(true, AdShowReadyStatus.None);
625
+
594
626
  ShowAd();
595
627
  HandleBeforeAdShow();
596
628
 
@@ -644,10 +676,10 @@ namespace Amanotes.Core.Internal
644
676
  }
645
677
 
646
678
  _showState = isSuccess ? ShowAdsState.ShowSuccess : ShowAdsState.ShowFail;
679
+
647
680
  // Extra callback
648
- if (isSuccess) Ads.context.result = AdResult.Success;
649
- Ads.context.onResult?.Invoke(Ads.context.result);
650
681
  Ads.context.showFinishAt = Time.realtimeSinceStartup;
682
+ Ads.context.onResult?.Invoke(isSuccess);
651
683
 
652
684
  var localData = Ads.localData;
653
685
  var stat = _isInterstitial ? localData.interstitial : localData.reward;
@@ -759,7 +791,6 @@ namespace Amanotes.Core.Internal
759
791
  if (Ads.context != null)
760
792
  {
761
793
  Ads.context.adCallback |= AdCallback.Fail;
762
- Ads.context.result = AdResult.AdapterReturnError;
763
794
  Ads.context.onShowFailed?.Invoke();
764
795
  }
765
796
  else
@@ -783,6 +814,30 @@ namespace Amanotes.Core.Internal
783
814
  }
784
815
  }
785
816
 
817
+ protected void OnAdShowReadyStatus(bool isReady, AdShowReadyStatus status)
818
+ {
819
+ if (Ads.context != null)
820
+ {
821
+ Ads.context.adCallback |= AdCallback.ShowReadyStatus;
822
+ if (!isReady)
823
+ {
824
+ Ads.context.onAdShowReadyStatus?.Invoke(status);
825
+ OnAdShowNotReady(status);
826
+ } else
827
+ {
828
+ OnAdShowReady();
829
+ }
830
+ }
831
+ else
832
+ {
833
+ LogWarning("[Ad] OnAdOpen() Something wrong - No AdContext");
834
+ }
835
+ }
836
+
837
+ protected virtual void OnAdShowCalled(){}
838
+ protected virtual void OnAdShowReady(){}
839
+ protected virtual void OnAdShowNotReady(AdShowReadyStatus status){}
840
+
786
841
  protected void OnAdOpen()
787
842
  {
788
843
  Log($"[Ad] {adType} OnAdOpen");
package/Runtime/AmaGDK.cs CHANGED
@@ -14,7 +14,7 @@ namespace Amanotes.Core
14
14
  {
15
15
  public partial class AmaGDK : MonoBehaviour
16
16
  {
17
- public const string VERSION = "0.2.35";
17
+ public const string VERSION = "0.2.36";
18
18
 
19
19
  internal static AmaGDK _instance;
20
20
  internal static Status _status = Status.None;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -1,297 +0,0 @@
1
- using System;
2
- using System.Collections;
3
- using System.Collections.Generic;
4
- using Amanotes.Core.Internal;
5
- using UnityEngine;
6
-
7
- namespace Amanotes.Core
8
- {
9
- public partial class AmaGDK // Ad events
10
- {
11
- public static class AdEventContext
12
- {
13
- public delegate void UpdateAdEventContext (string eventName);
14
- /// <summary>
15
- /// Update AdEventContext's variables for ad event tracking
16
- /// </summary>
17
- public static event UpdateAdEventContext Update;
18
-
19
- public static string connection;
20
- public static string location;
21
- public static string songACMid;
22
- public static string songName;
23
- public static string songUnlockType;
24
- public static string reward;
25
- public static string mediation;
26
- public static Dictionary<string, object> customData = new Dictionary<string, object>();
27
-
28
- internal static void UpdateFor(string eventName)
29
- {
30
- connection = null;
31
- location = null;
32
- songACMid = null;
33
- songName = null;
34
- songUnlockType = null;
35
- reward = null;
36
- mediation = null;
37
- customData.Clear();
38
- Update?.Invoke(eventName);
39
- }
40
- }
41
-
42
- public partial class AdEvents //Event name
43
- {
44
- const string FULLADS_REQUEST = "fullads_request";
45
- const string FULLADS_REQUEST_FAILED = "fullads_request_failed";
46
- const string FULLADS_REQUEST_SUCCESS = "fullads_request_success";
47
- const string FULLADS_SHOW_READY = "fullads_show_ready";
48
- const string FULLADS_SHOW_NOTREADY = "fullads_show_notready";
49
- const string FULLADS_SHOW = "fullads_show";
50
- const string FULLADS_SHOW_FAILED = "fullads_show_failed";
51
- const string FULLADS_FINISH = "fullads_finish";
52
- const string FULLADS_CLICK = "fullads_click";
53
-
54
- const string VIDEOADS_SHOW_READY = "videoads_show_ready";
55
- const string VIDEOADS_SHOW_NOTREADY = "videoads_show_notready";
56
- const string VIDEOADS_SHOW = "videoads_show";
57
- const string VIDEOADS_SHOW_FAILED = "videoads_show_failed";
58
- const string VIDEOADS_FINISH = "videoads_finish";
59
- const string VIDEOADS_CLICK = "videoads_click";
60
-
61
- const string BANNER_CLICK = "bannerads_click";
62
-
63
- //Parameter name
64
- const string PARAM_CONNECTION = "connection";
65
- const string PARAM_LOCATION = "location";
66
- const string PARAM_SONG_ACM_ID = "song_acm_id";
67
- const string PARAM_SONG_NAME = "song_name";
68
- const string PARAM_SONG_UNLOCK_TYPE = "song_unlock_type";
69
- const string PARAM_REWARD = "reward";
70
- const string PARAM_MEDIATION = "mediation";
71
- }
72
-
73
- public partial class AdEvents //Impression
74
- {
75
- public static Action<Dictionary<string, object>> onAdImpression;
76
-
77
- public static void LogAdImpression(Dictionary<string, object> impressionData)
78
- {
79
- Analytics.LogEvent("ad_impression", impressionData)
80
- .OnlyTo(AmaGDK.AdapterID.FIREBASE_ANALYTICS);
81
- Analytics.LogEvent("ad_impression_ama", impressionData)
82
- .OnlyTo(AmaGDK.AdapterID.FIREBASE_ANALYTICS);
83
- }
84
- }
85
-
86
- public partial class AdEvents //Full ads
87
- {
88
- public static void LogFullAdsRequest()
89
- {
90
- AdEventContext.UpdateFor(FULLADS_REQUEST);
91
- var dic = AdEventContext.customData;
92
- dic[PARAM_CONNECTION] = AdEventContext.connection;
93
- dic[PARAM_LOCATION] = AdEventContext.location;
94
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
95
- Analytics.LogEvent(FULLADS_REQUEST, dic).SetAsAccumulated();
96
- }
97
-
98
- public static void LogFullAdsRequestFailed()
99
- {
100
- AdEventContext.UpdateFor(FULLADS_REQUEST_FAILED);
101
- var dic = AdEventContext.customData;
102
- dic[PARAM_CONNECTION] = AdEventContext.connection;
103
- dic[PARAM_LOCATION] = AdEventContext.location;
104
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
105
- Analytics.LogEvent(FULLADS_REQUEST_FAILED, dic).SetAsAccumulated();
106
- }
107
-
108
- public static void LogFullAdsRequestSuccess()
109
- {
110
- AdEventContext.UpdateFor(FULLADS_REQUEST_SUCCESS);
111
- var dic = AdEventContext.customData;
112
- dic[PARAM_CONNECTION] = AdEventContext.connection;
113
- dic[PARAM_LOCATION] = AdEventContext.location;
114
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
115
- Analytics.LogEvent(FULLADS_REQUEST_SUCCESS, dic).SetAsAccumulated();
116
- }
117
-
118
- public static void LogFullAdsShowReady()
119
- {
120
- AdEventContext.UpdateFor(FULLADS_SHOW_READY);
121
- var dic = AdEventContext.customData;
122
- dic[PARAM_CONNECTION] = AdEventContext.connection;
123
- dic[PARAM_LOCATION] = AdEventContext.location;
124
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
125
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
126
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
127
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
128
- Analytics.LogEvent(FULLADS_SHOW_READY, dic).SetAsAccumulated();
129
- }
130
-
131
- public static void LogFullAdsShowNotReady()
132
- {
133
- AdEventContext.UpdateFor(FULLADS_SHOW_NOTREADY);
134
- var dic = AdEventContext.customData;
135
- dic[PARAM_CONNECTION] = AdEventContext.connection;
136
- dic[PARAM_LOCATION] = AdEventContext.location;
137
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
138
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
139
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
140
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
141
- Analytics.LogEvent(FULLADS_SHOW_NOTREADY, dic).SetAsAccumulated();
142
- }
143
-
144
- public static void LogFullAdsShow()
145
- {
146
- AdEventContext.UpdateFor(FULLADS_SHOW);
147
- var dic = AdEventContext.customData;
148
- dic[PARAM_CONNECTION] = AdEventContext.connection;
149
- dic[PARAM_LOCATION] = AdEventContext.location;
150
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
151
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
152
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
153
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
154
- Analytics.LogEvent(FULLADS_SHOW, dic).SetAsAccumulated();
155
- }
156
-
157
- public static void LogFullAdsShowFailed()
158
- {
159
- AdEventContext.UpdateFor(FULLADS_SHOW_FAILED);
160
- var dic = AdEventContext.customData;
161
- dic[PARAM_CONNECTION] = AdEventContext.connection;
162
- dic[PARAM_LOCATION] = AdEventContext.location;
163
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
164
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
165
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
166
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
167
- Analytics.LogEvent(FULLADS_SHOW_FAILED, dic).SetAsAccumulated();
168
- }
169
-
170
- public static void LogFullAdsFinish()
171
- {
172
- AdEventContext.UpdateFor(FULLADS_FINISH);
173
- var dic = AdEventContext.customData;
174
- dic[PARAM_CONNECTION] = AdEventContext.connection;
175
- dic[PARAM_LOCATION] = AdEventContext.location;
176
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
177
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
178
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
179
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
180
- Analytics.LogEvent(FULLADS_FINISH, dic).SetAsAccumulated();
181
- }
182
-
183
- public static void LogFullAdsClick()
184
- {
185
- AdEventContext.UpdateFor(FULLADS_CLICK);
186
- var dic = AdEventContext.customData;
187
- dic[PARAM_CONNECTION] = AdEventContext.connection;
188
- dic[PARAM_LOCATION] = AdEventContext.location;
189
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
190
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
191
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
192
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
193
- Analytics.LogEvent(FULLADS_CLICK, dic).SetAsAccumulated();
194
- }
195
- }
196
-
197
- public partial class AdEvents //Rewarded
198
- {
199
- public static void LogVideoAdsShowReady()
200
- {
201
- AdEventContext.UpdateFor(VIDEOADS_SHOW_READY);
202
- var dic = AdEventContext.customData;
203
- dic[PARAM_CONNECTION] = AdEventContext.connection;
204
- dic[PARAM_LOCATION] = AdEventContext.location;
205
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
206
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
207
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
208
- dic[PARAM_REWARD] = AdEventContext.reward;
209
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
210
- Analytics.LogEvent(VIDEOADS_SHOW_READY, dic).SetAsAccumulated();
211
- }
212
-
213
- public static void LogVideoAdsShowNotReady()
214
- {
215
- AdEventContext.UpdateFor(VIDEOADS_SHOW_NOTREADY);
216
- var dic = AdEventContext.customData;
217
- dic[PARAM_CONNECTION] = AdEventContext.connection;
218
- dic[PARAM_LOCATION] = AdEventContext.location;
219
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
220
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
221
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
222
- dic[PARAM_REWARD] = AdEventContext.reward;
223
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
224
- Analytics.LogEvent(VIDEOADS_SHOW_NOTREADY, dic).SetAsAccumulated();
225
- }
226
-
227
- public static void LogVideoAdsShow()
228
- {
229
- AdEventContext.UpdateFor(VIDEOADS_SHOW);
230
- var dic = AdEventContext.customData;
231
- dic[PARAM_CONNECTION] = AdEventContext.connection;
232
- dic[PARAM_LOCATION] = AdEventContext.location;
233
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
234
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
235
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
236
- dic[PARAM_REWARD] = AdEventContext.reward;
237
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
238
- Analytics.LogEvent(VIDEOADS_SHOW, dic).SetAsAccumulated();
239
- }
240
-
241
- public static void LogVideoAdsShowFailed()
242
- {
243
- AdEventContext.UpdateFor(VIDEOADS_SHOW_FAILED);
244
- var dic = AdEventContext.customData;
245
- dic[PARAM_CONNECTION] = AdEventContext.connection;
246
- dic[PARAM_LOCATION] = AdEventContext.location;
247
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
248
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
249
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
250
- dic[PARAM_REWARD] = AdEventContext.reward;
251
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
252
- Analytics.LogEvent(VIDEOADS_SHOW_FAILED, dic).SetAsAccumulated();
253
- }
254
-
255
- public static void LogVideoAdsFinish()
256
- {
257
- AdEventContext.UpdateFor(VIDEOADS_FINISH);
258
- var dic = AdEventContext.customData;
259
- dic[PARAM_CONNECTION] = AdEventContext.connection;
260
- dic[PARAM_LOCATION] = AdEventContext.location;
261
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
262
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
263
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
264
- dic[PARAM_REWARD] = AdEventContext.reward;
265
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
266
- Analytics.LogEvent(VIDEOADS_FINISH, dic).SetAsAccumulated();
267
- }
268
-
269
- public static void LogVideoAdsClick()
270
- {
271
- AdEventContext.UpdateFor(VIDEOADS_CLICK);
272
- var dic = AdEventContext.customData;
273
- dic[PARAM_CONNECTION] = AdEventContext.connection;
274
- dic[PARAM_LOCATION] = AdEventContext.location;
275
- dic[PARAM_SONG_ACM_ID] = AdEventContext.songACMid;
276
- dic[PARAM_SONG_NAME] = AdEventContext.songName;
277
- dic[PARAM_SONG_UNLOCK_TYPE] = AdEventContext.songUnlockType;
278
- dic[PARAM_REWARD] = AdEventContext.reward;
279
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
280
- Analytics.LogEvent(VIDEOADS_CLICK, dic).SetAsAccumulated();
281
- }
282
- }
283
-
284
- public partial class AdEvents //Banner
285
- {
286
- public static void LogBannerClick()
287
- {
288
- AdEventContext.UpdateFor(BANNER_CLICK);
289
- var dic = AdEventContext.customData;
290
- dic[PARAM_CONNECTION] = AdEventContext.connection;
291
- dic[PARAM_LOCATION] = AdEventContext.location;
292
- dic[PARAM_MEDIATION] = AdEventContext.mediation;
293
- Analytics.LogEvent(BANNER_CLICK, dic).SetAsAccumulated();
294
- }
295
- }
296
- }
297
- }
@@ -1,11 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: d65e821f5d1ce4c05aead50ca80d5b12
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant: