FIRIAMBaseRenderingViewController.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2018 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 <UIKit/UIKit.h>
  17. #import <FirebaseInAppMessaging/FIRInAppMessagingRendering.h>
  18. #import "FIRIAMTimeFetcher.h"
  19. @protocol FIRInAppMessagingDisplayDelegate;
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface FIRIAMBaseRenderingViewController : UIViewController
  22. @property(nonatomic, readwrite) id<FIRIAMTimeFetcher> timeFetcher;
  23. @property(nonatomic, readwrite) id<FIRInAppMessagingDisplayDelegate> displayDelegate;
  24. // These are the two methods we use to respond to app state change for the purpose of
  25. // actual display time tracking. Subclass can override this one to have more logic for responding
  26. // to the two events, but remember to trigger super's implementation.
  27. - (void)appWillBecomeInactive:(NSNotification *)notification;
  28. - (void)appDidBecomeActive:(NSNotification *)notification;
  29. // Tracking the aggregate impression time for the rendered message. Used to determine when
  30. // we are eaching the minimal iimpression time requirements. Exposed so that sub banner vc
  31. // class can use it for auto dismiss tracking
  32. @property(nonatomic) double aggregateImpressionTimeInSeconds;
  33. // Call this when the user choose to dismiss the message
  34. - (void)dismissView:(FIRInAppMessagingDismissType)dismissType;
  35. // Call this when end user wants to follow the action
  36. - (void)followAction:(FIRInAppMessagingAction *)action;
  37. // Returns the in-app message being displayed. Overridden by message type subclasses.
  38. - (nullable FIRInAppMessagingDisplayMessage *)inAppMessage;
  39. @end
  40. NS_ASSUME_NONNULL_END