FIRIAMClearcutLogger.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 "FirebaseInAppMessaging/Sources/Private/Analytics/FIRIAMClientInfoFetcher.h"
  18. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMAnalyticsEventLogger.h"
  19. #import "FirebaseInAppMessaging/Sources/Private/Util/FIRIAMTimeFetcher.h"
  20. @class FIRIAMClearcutUploader;
  21. NS_ASSUME_NONNULL_BEGIN
  22. // FIRIAMAnalyticsEventLogger implementation using Clearcut. It turns a IAM analytics event
  23. // into the corresponding FIRIAMClearcutLogRecord and then hand it over to
  24. // a FIRIAMClearcutUploader instance for the actual sending and potential failure and retry
  25. // logic
  26. @interface FIRIAMClearcutLogger : NSObject <FIRIAMAnalyticsEventLogger>
  27. - (instancetype)init NS_UNAVAILABLE;
  28. /**
  29. * Create an instance which uses NSURLSession to make clearcut api calls.
  30. *
  31. * @param clientInfoFetcher used to fetch iid info for the current app.
  32. * @param timeFetcher time fetcher object
  33. * @param uploader FIRIAMClearcutUploader object for receiving the log record
  34. */
  35. - (instancetype)initWithFBProjectNumber:(NSString *)fbProjectNumber
  36. fbAppId:(NSString *)fbAppId
  37. clientInfoFetcher:(FIRIAMClientInfoFetcher *)clientInfoFetcher
  38. usingTimeFetcher:(id<FIRIAMTimeFetcher>)timeFetcher
  39. usingUploader:(FIRIAMClearcutUploader *)uploader;
  40. @end
  41. NS_ASSUME_NONNULL_END