FIRIAMMessageContentDataWithImageURL.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #import <Foundation/Foundation.h>
  17. #import "FirebaseInAppMessaging/Sources/Private/Data/FIRIAMMessageContentData.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /**
  20. * An implementation for protocol FIRIAMMessageContentData. This class takes a image url
  21. * and fetch it over the network to retrieve the image data.
  22. */
  23. @interface FIRIAMMessageContentDataWithImageURL : NSObject <FIRIAMMessageContentData>
  24. /**
  25. * Create an instance which uses NSURLSession to do the image data fetching.
  26. *
  27. * @param title Message title text.
  28. * @param body Message body text.
  29. * @param actionButtonText Text for action button.
  30. * @param actionURL url string for action.
  31. * @param imageURL the url to the image. It can be nil to indicate the non-image in-app
  32. * message case.
  33. * @param URLSession can be nil in which case the class would create NSURLSession
  34. * internally to perform the network request. Having it here so that
  35. * it's easier for doing mocking with unit testing.
  36. */
  37. - (instancetype)initWithMessageTitle:(NSString *)title
  38. messageBody:(NSString *)body
  39. actionButtonText:(nullable NSString *)actionButtonText
  40. secondaryActionButtonText:(nullable NSString *)secondaryActionButtonText
  41. actionURL:(nullable NSURL *)actionURL
  42. secondaryActionURL:(nullable NSURL *)secondaryActionURL
  43. imageURL:(nullable NSURL *)imageURL
  44. landscapeImageURL:(nullable NSURL *)landscapeImageURL
  45. usingURLSession:(nullable NSURLSession *)URLSession;
  46. @end
  47. NS_ASSUME_NONNULL_END