FIRIAMRuntimeManager.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2017 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/Flows/FIRIAMActivityLogger.h"
  18. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMBookKeeper.h"
  19. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMDisplayExecutor.h"
  20. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMMessageClientCache.h"
  21. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMServerMsgFetchStorage.h"
  22. #import "FirebaseInAppMessaging/Sources/Private/Runtime/FIRIAMSDKSettings.h"
  23. NS_ASSUME_NONNULL_BEGIN
  24. // A class for managing the objects/dependencies for supporting different fiam flows at runtime
  25. NS_EXTENSION_UNAVAILABLE("Firebase In App Messaging is not supported for iOS extensions.")
  26. API_AVAILABLE(ios(13.0), tvos(13.0))
  27. @interface FIRIAMRuntimeManager : NSObject
  28. @property(nonatomic, nonnull) FIRIAMSDKSettings *currentSetting;
  29. @property(nonatomic, nonnull) FIRIAMActivityLogger *activityLogger;
  30. @property(nonatomic, nonnull) FIRIAMBookKeeperViaUserDefaults *bookKeeper;
  31. @property(nonatomic, nonnull) FIRIAMMessageClientCache *messageCache;
  32. @property(nonatomic, nonnull) FIRIAMServerMsgFetchStorage *fetchResultStorage;
  33. @property(nonatomic, nonnull) FIRIAMDisplayExecutor *displayExecutor;
  34. // Initialize fiam SDKs and start various flows with specified settings.
  35. - (void)startRuntimeWithSDKSettings:(FIRIAMSDKSettings *)settings;
  36. // Pause runtime flows/functions to disable SDK functions at runtime
  37. - (void)pause;
  38. // Resume runtime flows/functions.
  39. - (void)resume;
  40. // allows app to programmatically turn on/off auto data collection for fiam, which also implies
  41. // running/stopping fiam functionalities
  42. @property(nonatomic) BOOL automaticDataCollectionEnabled;
  43. // Get the global singleton instance
  44. + (FIRIAMRuntimeManager *)getSDKRuntimeInstance;
  45. // a method used to suppress or allow message being displayed based on the parameter
  46. // @param shouldSuppress if true, no new message is rendered by the sdk.
  47. - (void)setShouldSuppressMessageDisplay:(BOOL)shouldSuppress;
  48. @end
  49. NS_ASSUME_NONNULL_END