2019-02-01 17:05:36 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright 2017 Google
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
2020-08-12 11:21:06 -07:00
|
|
|
#import "FirebaseInAppMessaging/Sources/Private/Data/FIRIAMMessageContentData.h"
|
2019-02-01 17:05:36 -08:00
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
/**
|
|
|
|
|
* An implementation for protocol FIRIAMMessageContentData. This class takes a image url
|
|
|
|
|
* and fetch it over the network to retrieve the image data.
|
|
|
|
|
*/
|
|
|
|
|
@interface FIRIAMMessageContentDataWithImageURL : NSObject <FIRIAMMessageContentData>
|
|
|
|
|
/**
|
|
|
|
|
* Create an instance which uses NSURLSession to do the image data fetching.
|
|
|
|
|
*
|
|
|
|
|
* @param title Message title text.
|
|
|
|
|
* @param body Message body text.
|
|
|
|
|
* @param actionButtonText Text for action button.
|
|
|
|
|
* @param actionURL url string for action.
|
|
|
|
|
* @param imageURL the url to the image. It can be nil to indicate the non-image in-app
|
|
|
|
|
* message case.
|
|
|
|
|
* @param URLSession can be nil in which case the class would create NSURLSession
|
|
|
|
|
* internally to perform the network request. Having it here so that
|
|
|
|
|
* it's easier for doing mocking with unit testing.
|
|
|
|
|
*/
|
2023-05-08 15:18:36 -04:00
|
|
|
- (instancetype)initWithMessageTitle:(nullable NSString *)title
|
2023-11-03 11:36:20 -07:00
|
|
|
messageBody:(nullable NSString *)body
|
2019-02-01 17:05:36 -08:00
|
|
|
actionButtonText:(nullable NSString *)actionButtonText
|
2019-05-24 18:31:16 -04:00
|
|
|
secondaryActionButtonText:(nullable NSString *)secondaryActionButtonText
|
2019-02-01 17:05:36 -08:00
|
|
|
actionURL:(nullable NSURL *)actionURL
|
2019-05-24 18:31:16 -04:00
|
|
|
secondaryActionURL:(nullable NSURL *)secondaryActionURL
|
2019-02-01 17:05:36 -08:00
|
|
|
imageURL:(nullable NSURL *)imageURL
|
2019-05-24 18:31:16 -04:00
|
|
|
landscapeImageURL:(nullable NSURL *)landscapeImageURL
|
2019-02-01 17:05:36 -08:00
|
|
|
usingURLSession:(nullable NSURLSession *)URLSession;
|
|
|
|
|
@end
|
|
|
|
|
NS_ASSUME_NONNULL_END
|