FIRIAMDisplayExecutor.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/Analytics/FIRIAMClearcutLogger.h"
  18. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMActivityLogger.h"
  19. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMBookKeeper.h"
  20. #import "FirebaseInAppMessaging/Sources/Private/Flows/FIRIAMMessageClientCache.h"
  21. #import "FirebaseInAppMessaging/Sources/Private/Runtime/FIRIAMActionURLFollower.h"
  22. #import "FirebaseInAppMessaging/Sources/Private/Util/FIRIAMTimeFetcher.h"
  23. #import "FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging/FIRInAppMessaging.h"
  24. #import "FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging/FIRInAppMessagingRendering.h"
  25. NS_ASSUME_NONNULL_BEGIN
  26. @interface FIRIAMDisplaySetting : NSObject
  27. @property(nonatomic) NSTimeInterval displayMinIntervalInMinutes;
  28. @end
  29. // The class for checking if there are appropriate messages to be displayed and if so, render it.
  30. // There are other flows that would determine the timing for the checking and then use this class
  31. // instance for the actual check/display.
  32. //
  33. // In addition to fetch eligible message from message cache, this class also ensures certain
  34. // conditions are satisfied for the rendering
  35. // 1 No current in-app message is being displayed
  36. // 2 For non-contextual messages, the display interval in display setting is met.
  37. NS_EXTENSION_UNAVAILABLE("Firebase In App Messaging is not supported for iOS extensions.")
  38. @interface FIRIAMDisplayExecutor : NSObject
  39. - (instancetype)initWithInAppMessaging:(FIRInAppMessaging *)inAppMessaging
  40. setting:(FIRIAMDisplaySetting *)setting
  41. messageCache:(FIRIAMMessageClientCache *)cache
  42. timeFetcher:(id<FIRIAMTimeFetcher>)timeFetcher
  43. bookKeeper:(id<FIRIAMBookKeeper>)displayBookKeeper
  44. actionURLFollower:(FIRIAMActionURLFollower *)actionURLFollower
  45. activityLogger:(FIRIAMActivityLogger *)activityLogger
  46. analyticsEventLogger:(id<FIRIAMAnalyticsEventLogger>)analyticsEventLogger;
  47. // Check and display next in-app message eligible for app launch trigger
  48. - (void)checkAndDisplayNextAppLaunchMessage;
  49. // Check and display next in-app message eligible for app open trigger
  50. - (void)checkAndDisplayNextAppForegroundMessage;
  51. // Check and display next in-app message eligible for analytics event trigger with given event name.
  52. - (void)checkAndDisplayNextContextualMessageForAnalyticsEvent:(NSString *)eventName;
  53. // a boolean flag that can be used to suppress/resume displaying messages.
  54. @property(nonatomic) BOOL suppressMessageDisplay;
  55. // This is the display component used by display executor for actual message rendering.
  56. @property(nonatomic) id<FIRInAppMessagingDisplay> messageDisplayComponent;
  57. @end
  58. NS_ASSUME_NONNULL_END