Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
#import <Foundation/Foundation.h>
17
 
18
#import "FirebaseInAppMessaging/Sources/Private/Data/FIRIAMMessageRenderData.h"
19
#import "FirebaseInAppMessaging/Sources/Private/DisplayTrigger/FIRIAMDisplayTriggerDefinition.h"
20
 
21
@class FIRIAMDisplayTriggerDefinition;
22
 
23
@class ABTExperimentPayload;
24
 
25
NS_ASSUME_NONNULL_BEGIN
26
 
27
@interface FIRIAMMessageDefinition : NSObject
28
@property(nonatomic, nonnull, readonly) FIRIAMMessageRenderData *renderData;
29
 
30
// metadata data that does not affect the rendering content/effect directly
31
@property(nonatomic, readonly) NSTimeInterval startTime;
32
@property(nonatomic, readonly) NSTimeInterval endTime;
33
 
34
// a fiam message can have multiple triggers and any of them on its own can cause
35
// the message to be rendered
36
@property(nonatomic, readonly) NSArray<FIRIAMDisplayTriggerDefinition *> *renderTriggers;
37
 
38
/// A flag for client-side testing messages
39
@property(nonatomic, readonly) BOOL isTestMessage;
40
 
41
/// Additional key-value pairs that can be optionally sent along with the FIAM
42
@property(nonatomic, nullable, readonly) NSDictionary *appData;
43
 
44
@property(nonatomic, nullable, readonly) ABTExperimentPayload *experimentPayload;
45
 
46
- (instancetype)init NS_UNAVAILABLE;
47
 
48
/**
49
 * Create a regular message definition.
50
 */
51
- (instancetype)initWithRenderData:(FIRIAMMessageRenderData *)renderData
52
                         startTime:(NSTimeInterval)startTime
53
                           endTime:(NSTimeInterval)endTime
54
                 triggerDefinition:(NSArray<FIRIAMDisplayTriggerDefinition *> *)renderTriggers
55
                           appData:(nullable NSDictionary *)appData
56
                 experimentPayload:(nullable ABTExperimentPayload *)experimentPayload
57
                     isTestMessage:(BOOL)isTestMessage NS_DESIGNATED_INITIALIZER;
58
 
59
- (instancetype)initWithRenderData:(FIRIAMMessageRenderData *)renderData
60
                         startTime:(NSTimeInterval)startTime
61
                           endTime:(NSTimeInterval)endTime
62
                 triggerDefinition:(NSArray<FIRIAMDisplayTriggerDefinition *> *)renderTriggers;
63
 
64
/**
65
 * Create a test message definition.
66
 */
67
- (instancetype)initTestMessageWithRenderData:(FIRIAMMessageRenderData *)renderData
68
                                      appData:(nullable NSDictionary *)appData
69
                            experimentPayload:(nullable ABTExperimentPayload *)experimentPayload;
70
 
71
- (BOOL)messageHasExpired;
72
- (BOOL)messageHasStarted;
73
 
74
// should this message be rendered given the FIAM trigger type? only use this method for app launch
75
// and foreground trigger, use messageRenderedOnAnalyticsEvent: for analytics triggers
76
- (BOOL)messageRenderedOnTrigger:(FIRIAMRenderTrigger)trigger;
77
// should this message be rendered when a given analytics event is fired?
78
- (BOOL)messageRenderedOnAnalyticsEvent:(NSString *)eventName;
79
@end
80
NS_ASSUME_NONNULL_END