Skip to content

Commit 84ebe86

Browse files
authored
Clean up documentation to conform to Jazzy doc style (#3202)
* Fix up documentation for headless SDK. * Fix documentation in headful SDK.
1 parent 7d09fa8 commit 84ebe86

File tree

2 files changed

+92
-17
lines changed

2 files changed

+92
-17
lines changed

Firebase/InAppMessaging/Public/FIRInAppMessagingRendering.h

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@
1818

1919
NS_ASSUME_NONNULL_BEGIN
2020

21+
/// The type and UI style of an in-app message.
2122
typedef NS_ENUM(NSInteger, FIRInAppMessagingDisplayMessageType) {
23+
/// Modal style.
2224
FIRInAppMessagingDisplayMessageTypeModal,
25+
/// Banner style.
2326
FIRInAppMessagingDisplayMessageTypeBanner,
27+
/// Image-only style.
2428
FIRInAppMessagingDisplayMessageTypeImageOnly,
29+
/// Card style.
2530
FIRInAppMessagingDisplayMessageTypeCard
2631
};
2732

33+
/// Represents how an in-app message should be triggered to appear.
2834
typedef NS_ENUM(NSInteger, FIRInAppMessagingDisplayTriggerType) {
35+
/// Triggered on app foreground.
2936
FIRInAppMessagingDisplayTriggerTypeOnAppForeground,
37+
/// Triggered from an analytics event being fired.
3038
FIRInAppMessagingDisplayTriggerTypeOnAnalyticsEvent
3139
};
3240

@@ -50,7 +58,10 @@ NS_SWIFT_NAME(InAppMessagingActionButton)
5058
*/
5159
@property(nonatomic, copy, nonnull, readonly) UIColor *buttonBackgroundColor;
5260

61+
/// Unavailable.
5362
- (instancetype)init NS_UNAVAILABLE;
63+
64+
/// Deprecated, this class shouldn't be directly instantiated.
5465
- (instancetype)initWithButtonText:(NSString *)btnText
5566
buttonTextColor:(UIColor *)textColor
5667
backgroundColor:(UIColor *)bkgColor __deprecated;
@@ -60,26 +71,47 @@ NS_SWIFT_NAME(InAppMessagingActionButton)
6071
*/
6172
NS_SWIFT_NAME(InAppMessagingImageData)
6273
@interface FIRInAppMessagingImageData : NSObject
74+
75+
/**
76+
* Gets the image URL from image data.
77+
*/
6378
@property(nonatomic, nonnull, copy, readonly) NSString *imageURL;
6479

6580
/**
6681
* Gets the downloaded image data. It can be null if headless component fails to load it.
6782
*/
6883
@property(nonatomic, readonly, nullable) NSData *imageRawData;
6984

85+
/// Unavailable.
7086
- (instancetype)init NS_UNAVAILABLE;
87+
88+
/// Deprecated, this class shouldn't be directly instantiated.
7189
- (instancetype)initWithImageURL:(NSString *)imageURL imageData:(NSData *)imageData __deprecated;
7290
@end
7391

7492
/** Defines the metadata for the campaign to which a FIAM message belongs.
7593
*/
7694
@interface FIRInAppMessagingCampaignInfo : NSObject
7795

96+
/**
97+
* Identifier for the campaign for this message.
98+
*/
7899
@property(nonatomic, nonnull, copy, readonly) NSString *messageID;
100+
101+
/**
102+
* The name of this campaign, as defined in the console on campaign creation.
103+
*/
79104
@property(nonatomic, nonnull, copy, readonly) NSString *campaignName;
105+
106+
/**
107+
* Whether or not this message is being rendered in Test On Device mode.
108+
*/
80109
@property(nonatomic, readonly) BOOL renderAsTestMessage;
81110

111+
/// Unavailable.
82112
- (instancetype)init NS_UNAVAILABLE;
113+
114+
/// Deprecated, this class shouldn't be directly instantiated.
83115
- (instancetype)initWithMessageID:(NSString *)messageID
84116
campaignName:(NSString *)campaignName
85117
renderAsTestMessage:(BOOL)renderAsTestMessage __deprecated;
@@ -91,16 +123,19 @@ NS_SWIFT_NAME(InAppMessagingImageData)
91123
NS_SWIFT_NAME(InAppMessagingAction)
92124
@interface FIRInAppMessagingAction : NSObject
93125

94-
/*
126+
/**
95127
* The text of the action button, if applicable.
96128
*/
97129
@property(nonatomic, nullable, copy, readonly) NSString *actionText;
98-
/*
130+
/**
99131
* The URL to follow if the action is clicked.
100132
*/
101133
@property(nonatomic, nonnull, copy, readonly) NSURL *actionURL;
102134

135+
/// Unavailable.
103136
- (instancetype)init NS_UNAVAILABLE;
137+
138+
/// Deprecated, this class shouldn't be directly instantiated.
104139
- (instancetype)initWithActionText:(nullable NSString *)actionText
105140
actionURL:(NSURL *)actionURL __deprecated;
106141

@@ -112,11 +147,26 @@ NS_SWIFT_NAME(InAppMessagingAction)
112147
*/
113148
NS_SWIFT_NAME(InAppMessagingDisplayMessage)
114149
@interface FIRInAppMessagingDisplayMessage : NSObject
150+
151+
/**
152+
* Metadata for the campaign to which this message belongs.
153+
*/
115154
@property(nonatomic, copy, nonnull, readonly) FIRInAppMessagingCampaignInfo *campaignInfo;
155+
156+
/**
157+
* The type and UI style of this message.
158+
*/
116159
@property(nonatomic, readonly) FIRInAppMessagingDisplayMessageType type;
160+
161+
/**
162+
* How this message should be triggered.
163+
*/
117164
@property(nonatomic, readonly) FIRInAppMessagingDisplayTriggerType triggerType;
118165

166+
/// Unavailable.
119167
- (instancetype)init NS_UNAVAILABLE;
168+
169+
/// Deprecated, this class shouldn't be directly instantiated.
120170
- (instancetype)initWithMessageID:(NSString *)messageID
121171
campaignName:(NSString *)campaignName
122172
renderAsTestMessage:(BOOL)renderAsTestMessage
@@ -127,12 +177,12 @@ NS_SWIFT_NAME(InAppMessagingDisplayMessage)
127177
NS_SWIFT_NAME(InAppMessagingCardDisplay)
128178
@interface FIRInAppMessagingCardDisplay : FIRInAppMessagingDisplayMessage
129179

130-
/*
180+
/**
131181
* Gets the title text for a card FIAM message.
132182
*/
133183
@property(nonatomic, nonnull, copy, readonly) NSString *title;
134184

135-
/*
185+
/**
136186
* Gets the body text for a card FIAM message.
137187
*/
138188
@property(nonatomic, nullable, copy, readonly) NSString *body;
@@ -142,7 +192,7 @@ NS_SWIFT_NAME(InAppMessagingCardDisplay)
142192
*/
143193
@property(nonatomic, copy, nonnull, readonly) UIColor *textColor;
144194

145-
/*
195+
/**
146196
* Image data for the supplied portrait image for a card FIAM messasge.
147197
*/
148198
@property(nonatomic, nonnull, copy, readonly) FIRInAppMessagingImageData *portraitImageData;
@@ -177,6 +227,7 @@ NS_SWIFT_NAME(InAppMessagingCardDisplay)
177227
*/
178228
@property(nonatomic, nullable, readonly) NSURL *secondaryActionURL;
179229

230+
/// Unavailable.
180231
- (instancetype)init NS_UNAVAILABLE;
181232

182233
@end
@@ -221,7 +272,10 @@ NS_SWIFT_NAME(InAppMessagingModalDisplay)
221272
*/
222273
@property(nonatomic, copy, nonnull) UIColor *textColor;
223274

275+
/// Unavailable.
224276
- (instancetype)init NS_UNAVAILABLE;
277+
278+
/// Deprecated, this class shouldn't be directly instantiated.
225279
- (instancetype)initWithMessageID:(NSString *)messageID
226280
campaignName:(NSString *)campaignName
227281
renderAsTestMessage:(BOOL)renderAsTestMessage
@@ -239,11 +293,20 @@ NS_SWIFT_NAME(InAppMessagingModalDisplay)
239293
*/
240294
NS_SWIFT_NAME(InAppMessagingBannerDisplay)
241295
@interface FIRInAppMessagingBannerDisplay : FIRInAppMessagingDisplayMessage
242-
// Title is always required for modal messages.
296+
297+
/**
298+
* Gets the title of a banner message.
299+
*/
243300
@property(nonatomic, nonnull, copy, readonly) NSString *title;
244301

245-
// Image, body, action URL are all optional for banner messages.
302+
/**
303+
* Gets the image data for a banner message.
304+
*/
246305
@property(nonatomic, nullable, copy, readonly) FIRInAppMessagingImageData *imageData;
306+
307+
/**
308+
* Gets the body text for a banner message.
309+
*/
247310
@property(nonatomic, nullable, copy, readonly) NSString *bodyText;
248311

249312
/**
@@ -261,7 +324,10 @@ NS_SWIFT_NAME(InAppMessagingBannerDisplay)
261324
*/
262325
@property(nonatomic, nullable, readonly) NSURL *actionURL;
263326

327+
/// Unavailable.
264328
- (instancetype)init NS_UNAVAILABLE;
329+
330+
/// Deprecated, this class shouldn't be directly instantiated.
265331
- (instancetype)initWithMessageID:(NSString *)messageID
266332
campaignName:(NSString *)campaignName
267333
renderAsTestMessage:(BOOL)renderAsTestMessage
@@ -289,7 +355,10 @@ NS_SWIFT_NAME(InAppMessagingImageOnlyDisplay)
289355
*/
290356
@property(nonatomic, nullable, readonly) NSURL *actionURL;
291357

358+
/// Unavailable.
292359
- (instancetype)init NS_UNAVAILABLE;
360+
361+
/// Deprecated, this class shouldn't be directly instantiated.
293362
- (instancetype)initWithMessageID:(NSString *)messageID
294363
campaignName:(NSString *)campaignName
295364
renderAsTestMessage:(BOOL)renderAsTestMessage
@@ -298,20 +367,24 @@ NS_SWIFT_NAME(InAppMessagingImageOnlyDisplay)
298367
actionURL:(nullable NSURL *)actionURL __deprecated;
299368
@end
300369

370+
/// The way that an in-app message was dismissed.
301371
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,
307380
};
308381

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.
310383
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,
315388
};
316389

317390
/**

Firebase/InAppMessagingDisplay/Public/FIRIAMDefaultDisplayImpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ NS_SWIFT_NAME(InAppMessagingDefaultDisplayImpl)
2626
* to help UI Testing app access the UI layer directly.
2727
*/
2828
@interface FIRIAMDefaultDisplayImpl : NSObject <FIRInAppMessagingDisplay>
29+
30+
/// Conforms to display delegate for rendering of in-app messages.
2931
- (void)displayMessage:(FIRInAppMessagingDisplayMessage *)messageForDisplay
3032
displayDelegate:(id<FIRInAppMessagingDisplayDelegate>)displayDelegate;
3133
@end

0 commit comments

Comments
 (0)