FIRIAMAnalyticsEventLoggerImpl.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FIRIAMAnalyticsEventLogger.h"
  18. @class FIRIAMClearcutLogger;
  19. @protocol FIRIAMTimeFetcher;
  20. @protocol FIRAnalyticsInterop;
  21. NS_ASSUME_NONNULL_BEGIN
  22. /**
  23. * Implementation of protocol FIRIAMAnalyticsEventLogger by doing two things
  24. * 1 Firing Firebase Analytics Events for impressions and clicks and dismisses
  25. * 2 Making clearcut logging for all other types of analytics events
  26. */
  27. @interface FIRIAMAnalyticsEventLoggerImpl : NSObject <FIRIAMAnalyticsEventLogger>
  28. - (instancetype)init NS_UNAVAILABLE;
  29. /**
  30. *
  31. * @param userDefaults needed for tracking upload timing info persistently.If nil, using
  32. * NSUserDefaults standardUserDefaults. It's defined as a parameter to help with
  33. * unit testing mocking
  34. */
  35. - (instancetype)initWithClearcutLogger:(FIRIAMClearcutLogger *)ctLogger
  36. usingTimeFetcher:(id<FIRIAMTimeFetcher>)timeFetcher
  37. usingUserDefaults:(nullable NSUserDefaults *)userDefaults
  38. analytics:(nullable id<FIRAnalyticsInterop>)analytics;
  39. @end
  40. NS_ASSUME_NONNULL_END