FPRProtoUtils.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
  15. #import <CoreTelephony/CTTelephonyNetworkInfo.h>
  16. #endif
  17. #import "FirebasePerformance/Sources/AppActivity/FPRTraceBackgroundActivityTracker.h"
  18. #import "FirebasePerformance/Sources/Instrumentation/FPRNetworkTrace.h"
  19. #import "FirebasePerformance/Sources/Public/FIRTrace.h"
  20. #import "FirebasePerformance/ProtoSupport/PerfMetric.pbobjc.h"
  21. /** Creates a new FPRMSGPerfMetric proto object populated with system metadata.
  22. * @param appID The Google app id to put into the message
  23. * @return Reference to a FPRMSGPerfMetric object.
  24. */
  25. extern FPRMSGPerfMetric* _Nullable FPRGetPerfMetricMessage(NSString* _Nonnull appID);
  26. /** Creates a new FPRMSGApplicationInfo proto object populated with system metadata.
  27. * @return Reference to a FPRMSGApplicationInfo object.
  28. */
  29. extern FPRMSGApplicationInfo* _Nullable FPRGetApplicationInfoMessage(void);
  30. /** Converts the FIRTrace object to a FPRMSGTraceMetric proto object.
  31. * @return Reference to a FPRMSGTraceMetric object.
  32. */
  33. extern FPRMSGTraceMetric* _Nullable FPRGetTraceMetric(FIRTrace* _Nonnull trace);
  34. /** Converts the FPRNetworkTrace object to a FPRMSGNetworkRequestMetric proto object.
  35. * @return Reference to a FPRMSGNetworkRequestMetric object.
  36. */
  37. extern FPRMSGNetworkRequestMetric* _Nullable FPRGetNetworkRequestMetric(
  38. FPRNetworkTrace* _Nonnull trace);
  39. /** Converts the gaugeData array object to a FPRMSGGaugeMetric proto object.
  40. * @return Reference to a FPRMSGGaugeMetric object.
  41. */
  42. extern FPRMSGGaugeMetric* _Nullable FPRGetGaugeMetric(NSArray* _Nonnull gaugeData,
  43. NSString* _Nonnull sessionId);
  44. /** Converts the FPRTraceState to a FPRMSGApplicationProcessState proto value.
  45. * @return FPRMSGApplicationProcessState value.
  46. */
  47. extern FPRMSGApplicationProcessState FPRApplicationProcessState(FPRTraceState state);
  48. #if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
  49. /** Obtain a CTTelephonyNetworkInfo object to determine device network attributes.
  50. * @return CTTelephonyNetworkInfo object.
  51. */
  52. extern CTTelephonyNetworkInfo* _Nullable FPRNetworkInfo(void);
  53. #endif