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
 
17
#import <Foundation/Foundation.h>
18
 
19
NS_ASSUME_NONNULL_BEGIN
20
/**
21
 * This protocol models the message content (non-ui related) data for an in-app message.
22
 */
23
@protocol FIRIAMMessageContentData
24
@property(nonatomic, readonly, nonnull) NSString *titleText;
25
@property(nonatomic, readonly, nonnull) NSString *bodyText;
26
@property(nonatomic, readonly, nullable) NSString *actionButtonText;
27
@property(nonatomic, readonly, nullable) NSString *secondaryActionButtonText;
28
@property(nonatomic, readonly, nullable) NSURL *actionURL;
29
@property(nonatomic, readonly, nullable) NSURL *secondaryActionURL;
30
@property(nonatomic, readonly, nullable) NSURL *imageURL;
31
@property(nonatomic, readonly, nullable) NSURL *landscapeImageURL;
32
 
33
// Load image data, which can potentially have two images (one for landscape display). If only
34
// one image URL exists, that image is loaded and its data is passed in the callback block.
35
//
36
// If both standard and landscape URLs exist, then both images are fetched asynchronously. If the
37
// standard image fails to load, an error will be returned in the callback block and both image data
38
// slots will be empty.
39
// If only the landscape image fails to load, the standard image will be returned in the callback
40
// block and the error will be nil.
41
// If no error happens and the imageData parameter is nil, it indicates the case that there is no
42
// image associated with the message.
43
- (void)loadImageDataWithBlock:(void (^)(NSData *_Nullable imageData,
44
                                         NSData *_Nullable landscapeImageData,
45
                                         NSError *_Nullable error))block;
46
 
47
// convert to a description string of the content
48
- (NSString *)description;
49
@end
50
NS_ASSUME_NONNULL_END