20
20
21
21
@implementation FIRInAppMessagingDisplayMessage
22
22
23
+ - (instancetype )initWithMessageID : (NSString *)messageID
24
+ campaignName : (NSString *)campaignName
25
+ renderAsTestMessage : (BOOL )renderAsTestMessage
26
+ messageType : (FIRInAppMessagingDisplayMessageType)messageType
27
+ triggerType : (FIRInAppMessagingDisplayTriggerType)triggerType
28
+ appData : (NSDictionary *)appData {
29
+ if (self = [super init ]) {
30
+ #pragma clang diagnostic push
31
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
32
+ _campaignInfo = [[FIRInAppMessagingCampaignInfo alloc ] initWithMessageID: messageID
33
+ campaignName: campaignName
34
+ renderAsTestMessage: renderAsTestMessage];
35
+ #pragma clang diagnostic pop
36
+ _type = messageType;
37
+ _triggerType = triggerType;
38
+ _appData = [appData copy ];
39
+ }
40
+ return self;
41
+ }
42
+
23
43
- (instancetype )initWithMessageID : (NSString *)messageID
24
44
campaignName : (NSString *)campaignName
25
45
renderAsTestMessage : (BOOL )renderAsTestMessage
@@ -31,9 +51,11 @@ - (instancetype)initWithMessageID:(NSString *)messageID
31
51
renderAsTestMessage: renderAsTestMessage];
32
52
_type = messageType;
33
53
_triggerType = triggerType;
54
+ _appData = nil ;
34
55
}
35
56
return self;
36
57
}
58
+
37
59
@end
38
60
39
61
@implementation FIRInAppMessagingCardDisplay
@@ -54,6 +76,36 @@ - (void)setSecondaryActionURL:(NSURL *_Nullable)secondaryActionURL {
54
76
_secondaryActionURL = secondaryActionURL;
55
77
}
56
78
79
+ - (instancetype )initWithMessageID : (NSString *)messageID
80
+ campaignName : (NSString *)campaignName
81
+ renderAsTestMessage : (BOOL )renderAsTestMessage
82
+ triggerType : (FIRInAppMessagingDisplayTriggerType)triggerType
83
+ titleText : (NSString *)title
84
+ textColor : (UIColor *)textColor
85
+ portraitImageData : (FIRInAppMessagingImageData *)portraitImageData
86
+ backgroundColor : (UIColor *)backgroundColor
87
+ primaryActionButton : (FIRInAppMessagingActionButton *)primaryActionButton
88
+ primaryActionURL : (NSURL *)primaryActionURL
89
+ appData : (NSDictionary *)appData {
90
+ #pragma clang diagnostic push
91
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
92
+ if (self = [super initWithMessageID: messageID
93
+ campaignName: campaignName
94
+ renderAsTestMessage: renderAsTestMessage
95
+ messageType: FIRInAppMessagingDisplayMessageTypeCard
96
+ triggerType: triggerType
97
+ appData: appData]) {
98
+ #pragma clang diagnostic pop
99
+ _title = title;
100
+ _textColor = textColor;
101
+ _portraitImageData = portraitImageData;
102
+ _displayBackgroundColor = backgroundColor;
103
+ _primaryActionButton = primaryActionButton;
104
+ _primaryActionURL = primaryActionURL;
105
+ }
106
+ return self;
107
+ }
108
+
57
109
- (instancetype )initWithMessageID : (NSString *)messageID
58
110
campaignName : (NSString *)campaignName
59
111
renderAsTestMessage : (BOOL )renderAsTestMessage
@@ -70,7 +122,8 @@ - (instancetype)initWithMessageID:(NSString *)messageID
70
122
campaignName: campaignName
71
123
renderAsTestMessage: renderAsTestMessage
72
124
messageType: FIRInAppMessagingDisplayMessageTypeCard
73
- triggerType: triggerType]) {
125
+ triggerType: triggerType
126
+ appData: nil ]) {
74
127
#pragma clang diagnostic pop
75
128
_title = title;
76
129
_textColor = textColor;
@@ -85,6 +138,33 @@ - (instancetype)initWithMessageID:(NSString *)messageID
85
138
@end
86
139
87
140
@implementation FIRInAppMessagingBannerDisplay
141
+ - (instancetype )initWithMessageID : (NSString *)messageID
142
+ campaignName : (NSString *)campaignName
143
+ renderAsTestMessage : (BOOL )renderAsTestMessage
144
+ triggerType : (FIRInAppMessagingDisplayTriggerType)triggerType
145
+ titleText : (NSString *)title
146
+ bodyText : (NSString *)bodyText
147
+ textColor : (UIColor *)textColor
148
+ backgroundColor : (UIColor *)backgroundColor
149
+ imageData : (nullable FIRInAppMessagingImageData *)imageData
150
+ actionURL : (nullable NSURL *)actionURL
151
+ appData : (NSDictionary *)appData {
152
+ if (self = [super initWithMessageID: messageID
153
+ campaignName: campaignName
154
+ renderAsTestMessage: renderAsTestMessage
155
+ messageType: FIRInAppMessagingDisplayMessageTypeBanner
156
+ triggerType: triggerType
157
+ appData: appData]) {
158
+ _title = title;
159
+ _bodyText = bodyText;
160
+ _textColor = textColor;
161
+ _displayBackgroundColor = backgroundColor;
162
+ _imageData = imageData;
163
+ _actionURL = actionURL;
164
+ }
165
+ return self;
166
+ }
167
+
88
168
- (instancetype )initWithMessageID : (NSString *)messageID
89
169
campaignName : (NSString *)campaignName
90
170
renderAsTestMessage : (BOOL )renderAsTestMessage
@@ -99,7 +179,8 @@ - (instancetype)initWithMessageID:(NSString *)messageID
99
179
campaignName: campaignName
100
180
renderAsTestMessage: renderAsTestMessage
101
181
messageType: FIRInAppMessagingDisplayMessageTypeBanner
102
- triggerType: triggerType]) {
182
+ triggerType: triggerType
183
+ appData: nil ]) {
103
184
_title = title;
104
185
_bodyText = bodyText;
105
186
_textColor = textColor;
@@ -109,10 +190,40 @@ - (instancetype)initWithMessageID:(NSString *)messageID
109
190
}
110
191
return self;
111
192
}
193
+
112
194
@end
113
195
114
196
@implementation FIRInAppMessagingModalDisplay
115
197
198
+ - (instancetype )initWithMessageID : (NSString *)messageID
199
+ campaignName : (NSString *)campaignName
200
+ renderAsTestMessage : (BOOL )renderAsTestMessage
201
+ triggerType : (FIRInAppMessagingDisplayTriggerType)triggerType
202
+ titleText : (NSString *)title
203
+ bodyText : (NSString *)bodyText
204
+ textColor : (UIColor *)textColor
205
+ backgroundColor : (UIColor *)backgroundColor
206
+ imageData : (nullable FIRInAppMessagingImageData *)imageData
207
+ actionButton : (nullable FIRInAppMessagingActionButton *)actionButton
208
+ actionURL : (nullable NSURL *)actionURL
209
+ appData : (nullable NSDictionary *)appData {
210
+ if (self = [super initWithMessageID: messageID
211
+ campaignName: campaignName
212
+ renderAsTestMessage: renderAsTestMessage
213
+ messageType: FIRInAppMessagingDisplayMessageTypeModal
214
+ triggerType: triggerType
215
+ appData: appData]) {
216
+ _title = title;
217
+ _bodyText = bodyText;
218
+ _textColor = textColor;
219
+ _displayBackgroundColor = backgroundColor;
220
+ _imageData = imageData;
221
+ _actionButton = actionButton;
222
+ _actionURL = actionURL;
223
+ }
224
+ return self;
225
+ }
226
+
116
227
- (instancetype )initWithMessageID : (NSString *)messageID
117
228
campaignName : (NSString *)campaignName
118
229
renderAsTestMessage : (BOOL )renderAsTestMessage
@@ -128,7 +239,8 @@ - (instancetype)initWithMessageID:(NSString *)messageID
128
239
campaignName: campaignName
129
240
renderAsTestMessage: renderAsTestMessage
130
241
messageType: FIRInAppMessagingDisplayMessageTypeModal
131
- triggerType: triggerType]) {
242
+ triggerType: triggerType
243
+ appData: nil ]) {
132
244
_title = title;
133
245
_bodyText = bodyText;
134
246
_textColor = textColor;
@@ -143,6 +255,25 @@ - (instancetype)initWithMessageID:(NSString *)messageID
143
255
144
256
@implementation FIRInAppMessagingImageOnlyDisplay
145
257
258
+ - (instancetype )initWithMessageID : (NSString *)messageID
259
+ campaignName : (NSString *)campaignName
260
+ renderAsTestMessage : (BOOL )renderAsTestMessage
261
+ triggerType : (FIRInAppMessagingDisplayTriggerType)triggerType
262
+ imageData : (nullable FIRInAppMessagingImageData *)imageData
263
+ actionURL : (nullable NSURL *)actionURL
264
+ appData : (nullable NSDictionary *)appData {
265
+ if (self = [super initWithMessageID: messageID
266
+ campaignName: campaignName
267
+ renderAsTestMessage: renderAsTestMessage
268
+ messageType: FIRInAppMessagingDisplayMessageTypeModal
269
+ triggerType: triggerType
270
+ appData: appData]) {
271
+ _imageData = imageData;
272
+ _actionURL = actionURL;
273
+ }
274
+ return self;
275
+ }
276
+
146
277
- (instancetype )initWithMessageID : (NSString *)messageID
147
278
campaignName : (NSString *)campaignName
148
279
renderAsTestMessage : (BOOL )renderAsTestMessage
@@ -153,7 +284,8 @@ - (instancetype)initWithMessageID:(NSString *)messageID
153
284
campaignName: campaignName
154
285
renderAsTestMessage: renderAsTestMessage
155
286
messageType: FIRInAppMessagingDisplayMessageTypeModal
156
- triggerType: triggerType]) {
287
+ triggerType: triggerType
288
+ appData: nil ]) {
157
289
_imageData = imageData;
158
290
_actionURL = actionURL;
159
291
}
0 commit comments