You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.6 KiB

  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 <Foundation/Foundation.h>
  17. @protocol FIRAnalyticsInteropListener;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /// Block typedef callback parameter to getUserPropertiesWithCallback:.
  20. typedef void (^FIRAInteropUserPropertiesCallback)(NSDictionary<NSString *, id> *userProperties);
  21. /// Connector for bridging communication between Firebase SDKs and FirebaseAnalytics API.
  22. @protocol FIRAnalyticsInterop
  23. /// Sets user property when trigger event is logged. This API is only available in the SDK.
  24. - (void)setConditionalUserProperty:(NSDictionary<NSString *, id> *)conditionalUserProperty;
  25. /// Clears user property if set.
  26. - (void)clearConditionalUserProperty:(NSString *)userPropertyName
  27. forOrigin:(NSString *)origin
  28. clearEventName:(NSString *)clearEventName
  29. clearEventParameters:(NSDictionary<NSString *, NSString *> *)clearEventParameters;
  30. /// Returns currently set user properties.
  31. - (NSArray<NSDictionary<NSString *, NSString *> *> *)conditionalUserProperties:(NSString *)origin
  32. propertyNamePrefix:
  33. (NSString *)propertyNamePrefix;
  34. /// Returns the maximum number of user properties.
  35. - (NSInteger)maxUserProperties:(NSString *)origin;
  36. /// Returns the user properties to a callback function.
  37. - (void)getUserPropertiesWithCallback:(FIRAInteropUserPropertiesCallback)callback;
  38. /// Logs events.
  39. - (void)logEventWithOrigin:(NSString *)origin
  40. name:(NSString *)name
  41. parameters:(nullable NSDictionary<NSString *, id> *)parameters;
  42. /// Sets user property.
  43. - (void)setUserPropertyWithOrigin:(NSString *)origin name:(NSString *)name value:(id)value;
  44. /// Registers an Analytics listener for the given origin.
  45. - (void)registerAnalyticsListener:(id<FIRAnalyticsInteropListener>)listener
  46. withOrigin:(NSString *)origin;
  47. /// Unregisters an Analytics listener for the given origin.
  48. - (void)unregisterAnalyticsListenerWithOrigin:(NSString *)origin;
  49. @end
  50. NS_ASSUME_NONNULL_END