18
18
19
19
NS_ASSUME_NONNULL_BEGIN
20
20
21
+ // / The type and UI style of an in-app message.
21
22
typedef NS_ENUM (NSInteger , FIRInAppMessagingDisplayMessageType) {
23
+ // / Modal style.
22
24
FIRInAppMessagingDisplayMessageTypeModal,
25
+ // / Banner style.
23
26
FIRInAppMessagingDisplayMessageTypeBanner,
27
+ // / Image-only style.
24
28
FIRInAppMessagingDisplayMessageTypeImageOnly,
29
+ // / Card style.
25
30
FIRInAppMessagingDisplayMessageTypeCard
26
31
};
27
32
33
+ // / Represents how an in-app message should be triggered to appear.
28
34
typedef NS_ENUM (NSInteger , FIRInAppMessagingDisplayTriggerType) {
35
+ // / Triggered on app foreground.
29
36
FIRInAppMessagingDisplayTriggerTypeOnAppForeground,
37
+ // / Triggered from an analytics event being fired.
30
38
FIRInAppMessagingDisplayTriggerTypeOnAnalyticsEvent
31
39
};
32
40
@@ -50,7 +58,10 @@ NS_SWIFT_NAME(InAppMessagingActionButton)
50
58
*/
51
59
@property(nonatomic, copy, nonnull, readonly) UIColor *buttonBackgroundColor;
52
60
61
+ // / Unavailable.
53
62
- (instancetype )init NS_UNAVAILABLE;
63
+
64
+ // / Deprecated, this class shouldn't be directly instantiated.
54
65
- (instancetype )initWithButtonText:(NSString *)btnText
55
66
buttonTextColor:(UIColor *)textColor
56
67
backgroundColor:(UIColor *)bkgColor __deprecated;
@@ -60,26 +71,47 @@ NS_SWIFT_NAME(InAppMessagingActionButton)
60
71
*/
61
72
NS_SWIFT_NAME (InAppMessagingImageData)
62
73
@interface FIRInAppMessagingImageData : NSObject
74
+
75
+ /* *
76
+ * Gets the image URL from image data.
77
+ */
63
78
@property(nonatomic, nonnull, copy, readonly) NSString *imageURL;
64
79
65
80
/* *
66
81
* Gets the downloaded image data. It can be null if headless component fails to load it.
67
82
*/
68
83
@property(nonatomic, readonly, nullable) NSData *imageRawData;
69
84
85
+ // / Unavailable.
70
86
- (instancetype )init NS_UNAVAILABLE;
87
+
88
+ // / Deprecated, this class shouldn't be directly instantiated.
71
89
- (instancetype )initWithImageURL:(NSString *)imageURL imageData:(NSData *)imageData __deprecated;
72
90
@end
73
91
74
92
/* * Defines the metadata for the campaign to which a FIAM message belongs.
75
93
*/
76
94
@interface FIRInAppMessagingCampaignInfo : NSObject
77
95
96
+ /* *
97
+ * Identifier for the campaign for this message.
98
+ */
78
99
@property (nonatomic , nonnull , copy , readonly ) NSString *messageID;
100
+
101
+ /* *
102
+ * The name of this campaign, as defined in the console on campaign creation.
103
+ */
79
104
@property (nonatomic , nonnull , copy , readonly ) NSString *campaignName;
105
+
106
+ /* *
107
+ * Whether or not this message is being rendered in Test On Device mode.
108
+ */
80
109
@property (nonatomic , readonly ) BOOL renderAsTestMessage;
81
110
111
+ // / Unavailable.
82
112
- (instancetype )init NS_UNAVAILABLE;
113
+
114
+ // / Deprecated, this class shouldn't be directly instantiated.
83
115
- (instancetype )initWithMessageID : (NSString *)messageID
84
116
campaignName : (NSString *)campaignName
85
117
renderAsTestMessage : (BOOL )renderAsTestMessage __deprecated;
@@ -91,16 +123,19 @@ NS_SWIFT_NAME(InAppMessagingImageData)
91
123
NS_SWIFT_NAME (InAppMessagingAction)
92
124
@interface FIRInAppMessagingAction : NSObject
93
125
94
- /*
126
+ /* *
95
127
* The text of the action button, if applicable.
96
128
*/
97
129
@property(nonatomic, nullable, copy, readonly) NSString *actionText;
98
- /*
130
+ /* *
99
131
* The URL to follow if the action is clicked.
100
132
*/
101
133
@property(nonatomic, nonnull, copy, readonly) NSURL *actionURL;
102
134
135
+ // / Unavailable.
103
136
- (instancetype )init NS_UNAVAILABLE;
137
+
138
+ // / Deprecated, this class shouldn't be directly instantiated.
104
139
- (instancetype )initWithActionText:(nullable NSString *)actionText
105
140
actionURL:(NSURL *)actionURL __deprecated;
106
141
@@ -112,11 +147,26 @@ NS_SWIFT_NAME(InAppMessagingAction)
112
147
*/
113
148
NS_SWIFT_NAME (InAppMessagingDisplayMessage)
114
149
@interface FIRInAppMessagingDisplayMessage : NSObject
150
+
151
+ /* *
152
+ * Metadata for the campaign to which this message belongs.
153
+ */
115
154
@property(nonatomic, copy, nonnull, readonly) FIRInAppMessagingCampaignInfo *campaignInfo;
155
+
156
+ /* *
157
+ * The type and UI style of this message.
158
+ */
116
159
@property(nonatomic, readonly) FIRInAppMessagingDisplayMessageType type;
160
+
161
+ /* *
162
+ * How this message should be triggered.
163
+ */
117
164
@property(nonatomic, readonly) FIRInAppMessagingDisplayTriggerType triggerType;
118
165
166
+ // / Unavailable.
119
167
- (instancetype )init NS_UNAVAILABLE;
168
+
169
+ // / Deprecated, this class shouldn't be directly instantiated.
120
170
- (instancetype )initWithMessageID:(NSString *)messageID
121
171
campaignName:(NSString *)campaignName
122
172
renderAsTestMessage:(BOOL )renderAsTestMessage
@@ -127,12 +177,12 @@ NS_SWIFT_NAME(InAppMessagingDisplayMessage)
127
177
NS_SWIFT_NAME (InAppMessagingCardDisplay)
128
178
@interface FIRInAppMessagingCardDisplay : FIRInAppMessagingDisplayMessage
129
179
130
- /*
180
+ /* *
131
181
* Gets the title text for a card FIAM message.
132
182
*/
133
183
@property(nonatomic, nonnull, copy, readonly) NSString *title;
134
184
135
- /*
185
+ /* *
136
186
* Gets the body text for a card FIAM message.
137
187
*/
138
188
@property(nonatomic, nullable, copy, readonly) NSString *body;
@@ -142,7 +192,7 @@ NS_SWIFT_NAME(InAppMessagingCardDisplay)
142
192
*/
143
193
@property(nonatomic, copy, nonnull, readonly) UIColor *textColor;
144
194
145
- /*
195
+ /* *
146
196
* Image data for the supplied portrait image for a card FIAM messasge.
147
197
*/
148
198
@property(nonatomic, nonnull, copy, readonly) FIRInAppMessagingImageData *portraitImageData;
@@ -177,6 +227,7 @@ NS_SWIFT_NAME(InAppMessagingCardDisplay)
177
227
*/
178
228
@property(nonatomic, nullable, readonly) NSURL *secondaryActionURL;
179
229
230
+ // / Unavailable.
180
231
- (instancetype )init NS_UNAVAILABLE;
181
232
182
233
@end
@@ -221,7 +272,10 @@ NS_SWIFT_NAME(InAppMessagingModalDisplay)
221
272
*/
222
273
@property(nonatomic, copy, nonnull) UIColor *textColor;
223
274
275
+ // / Unavailable.
224
276
- (instancetype )init NS_UNAVAILABLE;
277
+
278
+ // / Deprecated, this class shouldn't be directly instantiated.
225
279
- (instancetype )initWithMessageID:(NSString *)messageID
226
280
campaignName:(NSString *)campaignName
227
281
renderAsTestMessage:(BOOL )renderAsTestMessage
@@ -239,11 +293,20 @@ NS_SWIFT_NAME(InAppMessagingModalDisplay)
239
293
*/
240
294
NS_SWIFT_NAME (InAppMessagingBannerDisplay)
241
295
@interface FIRInAppMessagingBannerDisplay : FIRInAppMessagingDisplayMessage
242
- // Title is always required for modal messages.
296
+
297
+ /* *
298
+ * Gets the title of a banner message.
299
+ */
243
300
@property(nonatomic, nonnull, copy, readonly) NSString *title;
244
301
245
- // Image, body, action URL are all optional for banner messages.
302
+ /* *
303
+ * Gets the image data for a banner message.
304
+ */
246
305
@property(nonatomic, nullable, copy, readonly) FIRInAppMessagingImageData *imageData;
306
+
307
+ /* *
308
+ * Gets the body text for a banner message.
309
+ */
247
310
@property(nonatomic, nullable, copy, readonly) NSString *bodyText;
248
311
249
312
/* *
@@ -261,7 +324,10 @@ NS_SWIFT_NAME(InAppMessagingBannerDisplay)
261
324
*/
262
325
@property(nonatomic, nullable, readonly) NSURL *actionURL;
263
326
327
+ // / Unavailable.
264
328
- (instancetype )init NS_UNAVAILABLE;
329
+
330
+ // / Deprecated, this class shouldn't be directly instantiated.
265
331
- (instancetype )initWithMessageID:(NSString *)messageID
266
332
campaignName:(NSString *)campaignName
267
333
renderAsTestMessage:(BOOL )renderAsTestMessage
@@ -289,7 +355,10 @@ NS_SWIFT_NAME(InAppMessagingImageOnlyDisplay)
289
355
*/
290
356
@property(nonatomic, nullable, readonly) NSURL *actionURL;
291
357
358
+ // / Unavailable.
292
359
- (instancetype )init NS_UNAVAILABLE;
360
+
361
+ // / Deprecated, this class shouldn't be directly instantiated.
293
362
- (instancetype )initWithMessageID:(NSString *)messageID
294
363
campaignName:(NSString *)campaignName
295
364
renderAsTestMessage:(BOOL )renderAsTestMessage
@@ -298,20 +367,24 @@ NS_SWIFT_NAME(InAppMessagingImageOnlyDisplay)
298
367
actionURL:(nullable NSURL *)actionURL __deprecated;
299
368
@end
300
369
370
+ // / The way that an in-app message was dismissed.
301
371
typedef NS_ENUM (NSInteger , FIRInAppMessagingDismissType) {
302
- FIRInAppMessagingDismissTypeUserSwipe, // user swipes away the banner view
303
- FIRInAppMessagingDismissTypeUserTapClose, // user clicks on close buttons
304
- FIRInAppMessagingDismissTypeAuto, // automatic dismiss from banner view
305
- FIRInAppMessagingDismissUnspecified, // message is dismissed, but not belonging to any
306
- // above dismiss category.
372
+ // / Message was swiped away (only valid for banner messages).
373
+ FIRInAppMessagingDismissTypeUserSwipe,
374
+ // / The user tapped a button to close this message.
375
+ FIRInAppMessagingDismissTypeUserTapClose,
376
+ // / The message was automatically dismissed (only valid for banner messages).
377
+ FIRInAppMessagingDismissTypeAuto,
378
+ // / Dismiss method unknown.
379
+ FIRInAppMessagingDismissUnspecified,
307
380
};
308
381
309
- // enum integer value used in as code for NSError reported from displayErrorEncountered: callback
382
+ // / Error code for an in-app message that failed to display.
310
383
typedef NS_ENUM (NSInteger , FIAMDisplayRenderErrorType) {
311
- FIAMDisplayRenderErrorTypeImageDataInvalid, // provided image data is not valid for image
312
- // rendering
313
- FIAMDisplayRenderErrorTypeUnspecifiedError, // error not classified, mainly unexpected
314
- // failure cases
384
+ // / The image data for this in-app message is invalid.
385
+ FIAMDisplayRenderErrorTypeImageDataInvalid,
386
+ // / Unexpected error.
387
+ FIAMDisplayRenderErrorTypeUnspecifiedError,
315
388
};
316
389
317
390
/* *
0 commit comments