FIRMessagingExtensionHelper.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2019 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. @class UNMutableNotificationContent, UNNotificationContent;
  18. #if __has_include(<UserNotifications/UserNotifications.h>)
  19. #import <UserNotifications/UserNotifications.h>
  20. #endif
  21. NS_ASSUME_NONNULL_BEGIN
  22. /// This class is used to automatically populate a notification with an image if it is
  23. /// specified in the notification body via the `image` parameter. Images and other
  24. /// rich content can be populated manually without the use of this class. See the
  25. /// `UNNotificationServiceExtension` type for more details.
  26. __OSX_AVAILABLE(10.14) @interface FIRMessagingExtensionHelper : NSObject
  27. /// Call this API to complete your notification content modification. If you like to
  28. /// overwrite some properties of the content instead of using the default payload,
  29. /// make sure to make your customized motification to the content before passing it to
  30. /// this call.
  31. - (void)populateNotificationContent:(UNMutableNotificationContent *)content
  32. withContentHandler:(void (^)(UNNotificationContent *_Nonnull))contentHandler;
  33. /// Exports delivery metrics to BigQuery. Call this API to enable logging delivery of alert
  34. /// notification or background notification and export to BigQuery.
  35. /// If you log alert notifications, enable Notification Service Extension and calls this API
  36. /// under `UNNotificationServiceExtension didReceiveNotificationRequest: withContentHandler:`.
  37. /// If you log background notifications, call the API under `UIApplicationDelegate
  38. /// application:didReceiveRemoteNotification:fetchCompletionHandler:`.
  39. - (void)exportDeliveryMetricsToBigQueryWithMessageInfo:(NSDictionary *)info;
  40. @end
  41. NS_ASSUME_NONNULL_END