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