28
28
29
29
#if defined(_WIN32)
30
30
#include < windows.h>
31
+
31
32
#include " analytics_windows.h"
32
33
#endif // defined(_WIN32)
33
34
@@ -101,7 +102,7 @@ void Initialize(const App& app) {
101
102
c_options->app_id = current_app_id.c_str ();
102
103
c_options->package_name = current_package_name.c_str ();
103
104
c_options->analytics_collection_enabled_at_first_launch =
104
- g_analytics_collection_enabled;
105
+ g_analytics_collection_enabled;
105
106
106
107
LogInfo (
107
108
" Analytics: Initializing Google Analytics C API with App ID: %s, "
@@ -180,13 +181,14 @@ static void ConvertParametersToGAParams(
180
181
// ItemVector) are handled.
181
182
#if defined(_WIN32)
182
183
if (g_analytics_module) {
183
- // Only log this if we are not in stub mode.
184
- LogError (
185
- " Analytics: Parameter '%s' has type Vector, which is unsupported for "
186
- " event parameters on Desktop. Skipping." ,
187
- param.name );
184
+ // Only log this if we are not in stub mode.
185
+ LogError (
186
+ " Analytics: Parameter '%s' has type Vector, which is unsupported "
187
+ " for "
188
+ " event parameters on Desktop. Skipping." ,
189
+ param.name );
188
190
}
189
- #endif // defined(_WIN32)
191
+ #endif // defined(_WIN32)
190
192
continue ; // Skip this parameter
191
193
} else if (param.value .is_map ()) {
192
194
// This block handles parameters that are maps.
@@ -440,11 +442,12 @@ void SetConsent(const std::map<ConsentType, ConsentStatus>& consent_settings) {
440
442
// Not supported by the Windows C API.
441
443
(void )consent_settings; // Mark as unused
442
444
#if defined(_WIN32)
443
- if (g_analytics_module) {
444
- // Only log this if we are not in stub mode.
445
- LogWarning (
446
- " Analytics: SetConsent() is not supported and has no effect on Desktop." );
447
- }
445
+ if (g_analytics_module) {
446
+ // Only log this if we are not in stub mode.
447
+ LogWarning (
448
+ " Analytics: SetConsent() is not supported and has no effect on "
449
+ " Desktop." );
450
+ }
448
451
#endif // defined(_WIN32)
449
452
}
450
453
@@ -453,12 +456,12 @@ void InitiateOnDeviceConversionMeasurementWithEmailAddress(
453
456
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
454
457
(void )email_address;
455
458
#if defined(_WIN32)
456
- if (g_analytics_module) {
457
- // Only log this if we are not in stub mode.
458
- LogWarning (
459
- " Analytics: InitiateOnDeviceConversionMeasurementWithEmailAddress() is "
460
- " not supported and has no effect on Desktop." );
461
- }
459
+ if (g_analytics_module) {
460
+ // Only log this if we are not in stub mode.
461
+ LogWarning (
462
+ " Analytics: InitiateOnDeviceConversionMeasurementWithEmailAddress() is "
463
+ " not supported and has no effect on Desktop." );
464
+ }
462
465
#endif // defined(_WIN32)
463
466
}
464
467
@@ -467,12 +470,12 @@ void InitiateOnDeviceConversionMeasurementWithPhoneNumber(
467
470
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
468
471
(void )phone_number;
469
472
#if defined(_WIN32)
470
- if (g_analytics_module) {
471
- // Only log this if we are not in stub mode.
472
- LogWarning (
473
- " Analytics: InitiateOnDeviceConversionMeasurementWithPhoneNumber() is "
474
- " not supported and has no effect on Desktop." );
475
- }
473
+ if (g_analytics_module) {
474
+ // Only log this if we are not in stub mode.
475
+ LogWarning (
476
+ " Analytics: InitiateOnDeviceConversionMeasurementWithPhoneNumber() is "
477
+ " not supported and has no effect on Desktop." );
478
+ }
476
479
#endif // defined(_WIN32)
477
480
}
478
481
@@ -481,13 +484,13 @@ void InitiateOnDeviceConversionMeasurementWithHashedEmailAddress(
481
484
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
482
485
(void )hashed_email_address;
483
486
#if defined(_WIN32)
484
- if (g_analytics_module) {
485
- // Only log this if we are not in stub mode.
486
- LogWarning (
487
- " Analytics: "
488
- " InitiateOnDeviceConversionMeasurementWithHashedEmailAddress() is not "
489
- " supported and has no effect on Desktop." );
490
- }
487
+ if (g_analytics_module) {
488
+ // Only log this if we are not in stub mode.
489
+ LogWarning (
490
+ " Analytics: "
491
+ " InitiateOnDeviceConversionMeasurementWithHashedEmailAddress() is not "
492
+ " supported and has no effect on Desktop." );
493
+ }
491
494
#endif // defined(_WIN32)
492
495
}
493
496
@@ -496,25 +499,26 @@ void InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
496
499
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
497
500
(void )hashed_phone_number;
498
501
#if defined(_WIN32)
499
- if (g_analytics_module) {
500
- // Only log this if we are not in stub mode.
501
- LogWarning (
502
- " Analytics: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber() "
503
- " is not supported and has no effect on Desktop." );
504
- }
502
+ if (g_analytics_module) {
503
+ // Only log this if we are not in stub mode.
504
+ LogWarning (
505
+ " Analytics: "
506
+ " InitiateOnDeviceConversionMeasurementWithHashedPhoneNumber() "
507
+ " is not supported and has no effect on Desktop." );
508
+ }
505
509
#endif // defined(_WIN32)
506
510
}
507
511
508
512
void SetSessionTimeoutDuration (int64_t milliseconds) {
509
513
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
510
514
(void )milliseconds;
511
515
#if defined(_WIN32)
512
- if (g_analytics_module) {
513
- // Only log this if we are not in stub mode.
514
- LogWarning (
515
- " Analytics: SetSessionTimeoutDuration() is not supported and has no "
516
- " effect on Desktop." );
517
- }
516
+ if (g_analytics_module) {
517
+ // Only log this if we are not in stub mode.
518
+ LogWarning (
519
+ " Analytics: SetSessionTimeoutDuration() is not supported and has no "
520
+ " effect on Desktop." );
521
+ }
518
522
#endif // defined(_WIN32)
519
523
}
520
524
@@ -532,11 +536,11 @@ Future<std::string> GetAnalyticsInstanceId() {
532
536
api->CompleteWithResult (future_handle, 0 , " " , instance_id);
533
537
534
538
#if defined(_WIN32)
535
- if (g_analytics_module) {
536
- // Only log this if we are not in stub mode.
537
- LogWarning (
538
- " Analytics: GetAnalyticsInstanceId() is not supported on Desktop." );
539
- }
539
+ if (g_analytics_module) {
540
+ // Only log this if we are not in stub mode.
541
+ LogWarning (
542
+ " Analytics: GetAnalyticsInstanceId() is not supported on Desktop." );
543
+ }
540
544
#endif // defined(_WIN32)
541
545
return Future<std::string>(api, future_handle.get ());
542
546
}
@@ -573,7 +577,7 @@ Future<int64_t> GetSessionIdLastResult() {
573
577
if (g_analytics_module) {
574
578
// Only log this if we are not in stub mode.
575
579
LogWarning (
576
- " Analytics: GetSessionIdLastResult() is not supported on Desktop." );
580
+ " Analytics: GetSessionIdLastResult() is not supported on Desktop." );
577
581
}
578
582
#endif // defined(_WIN32)
579
583
return static_cast <const Future<int64_t >&>(
0 commit comments