@capacitor-firebase/performance 0.5.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '12.0'
14
+ s.ios.deployment_target = '13.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.dependency 'Firebase/Performance', '9.1.0'
17
17
  s.swift_version = '5.1'
package/README.md CHANGED
@@ -13,8 +13,6 @@ Add Firebase to your project if you haven't already ([Android](https://firebase.
13
13
 
14
14
  ### Android
15
15
 
16
- **Attention**: Please make sure that you are using **Java 11**.
17
-
18
16
  See [Add the Performance Monitoring plugin to your app](https://firebase.google.com/docs/perf-mon/get-started-android#add-perfmon-plugin) and follow the instructions to set up your app correctly.
19
17
 
20
18
  #### Variables
@@ -69,8 +67,8 @@ const isPerformanceCollectionEnabled = async () => {
69
67
  * [`startTrace(...)`](#starttrace)
70
68
  * [`stopTrace(...)`](#stoptrace)
71
69
  * [`incrementMetric(...)`](#incrementmetric)
72
- * [`setPerformanceCollectionEnabled(...)`](#setperformancecollectionenabled)
73
- * [`isPerformanceCollectionEnabled()`](#isperformancecollectionenabled)
70
+ * [`setEnabled(...)`](#setenabled)
71
+ * [`isEnabled()`](#isenabled)
74
72
  * [Interfaces](#interfaces)
75
73
 
76
74
  </docgen-index>
@@ -129,33 +127,33 @@ Atomically increments the metric with the given name for the selected trace by t
129
127
  --------------------
130
128
 
131
129
 
132
- ### setPerformanceCollectionEnabled(...)
130
+ ### setEnabled(...)
133
131
 
134
132
  ```typescript
135
- setPerformanceCollectionEnabled(options: SetPerformanceCollectionEnabledOptions) => Promise<void>
133
+ setEnabled(options: SetEnabledOptions) => Promise<void>
136
134
  ```
137
135
 
138
136
  Enables or disables performance monitoring.
139
137
  Will be applied with the next start of the app.
140
138
 
141
- | Param | Type |
142
- | ------------- | --------------------------------------------------------------------------------------------------------- |
143
- | **`options`** | <code><a href="#setperformancecollectionenabledoptions">SetPerformanceCollectionEnabledOptions</a></code> |
139
+ | Param | Type |
140
+ | ------------- | --------------------------------------------------------------- |
141
+ | **`options`** | <code><a href="#setenabledoptions">SetEnabledOptions</a></code> |
144
142
 
145
143
  **Since:** 0.1.0
146
144
 
147
145
  --------------------
148
146
 
149
147
 
150
- ### isPerformanceCollectionEnabled()
148
+ ### isEnabled()
151
149
 
152
150
  ```typescript
153
- isPerformanceCollectionEnabled() => Promise<IsPerformanceCollectionEnabledResult>
151
+ isEnabled() => Promise<IsEnabledResult>
154
152
  ```
155
153
 
156
154
  Determines whether performance monitoring is enabled or disabled.
157
155
 
158
- **Returns:** <code>Promise&lt;<a href="#isperformancecollectionenabledresult">IsPerformanceCollectionEnabledResult</a>&gt;</code>
156
+ **Returns:** <code>Promise&lt;<a href="#isenabledresult">IsEnabledResult</a>&gt;</code>
159
157
 
160
158
  **Since:** 0.1.0
161
159
 
@@ -188,14 +186,14 @@ Determines whether performance monitoring is enabled or disabled.
188
186
  | **`incrementBy`** | <code>number</code> | Amount by which the metric has to be incremented. | <code>1</code> | 0.1.0 |
189
187
 
190
188
 
191
- #### SetPerformanceCollectionEnabledOptions
189
+ #### SetEnabledOptions
192
190
 
193
191
  | Prop | Type | Description | Since |
194
192
  | ------------- | -------------------- | ----------------------------------------- | ----- |
195
193
  | **`enabled`** | <code>boolean</code> | Should performance monitoring be enabled. | 0.1.0 |
196
194
 
197
195
 
198
- #### IsPerformanceCollectionEnabledResult
196
+ #### IsEnabledResult
199
197
 
200
198
  | Prop | Type | Description | Since |
201
199
  | ------------- | -------------------- | --------------------------------------------------------------- | ----- |
@@ -1,8 +1,8 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
6
6
  firebasePerfVersion = project.hasProperty('firebasePerfVersion') ? rootProject.ext.firebasePerfVersion : '20.0.6'
7
7
  }
8
8
 
@@ -12,17 +12,17 @@ buildscript {
12
12
  mavenCentral()
13
13
  }
14
14
  dependencies {
15
- classpath 'com.android.tools.build:gradle:4.2.1'
15
+ classpath 'com.android.tools.build:gradle:7.2.1'
16
16
  }
17
17
  }
18
18
 
19
19
  apply plugin: 'com.android.library'
20
20
 
21
21
  android {
22
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
22
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
23
23
  defaultConfig {
24
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
25
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
24
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
25
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
26
26
  versionCode 1
27
27
  versionName "1.0"
28
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -37,15 +37,14 @@ android {
37
37
  abortOnError false
38
38
  }
39
39
  compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_1_8
41
- targetCompatibility JavaVersion.VERSION_1_8
40
+ sourceCompatibility JavaVersion.VERSION_11
41
+ targetCompatibility JavaVersion.VERSION_11
42
42
  }
43
43
  }
44
44
 
45
45
  repositories {
46
46
  google()
47
47
  mavenCentral()
48
- jcenter()
49
48
  }
50
49
 
51
50
 
@@ -1,3 +1,3 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="dev.robingenz.capacitorjs.plugins.firebase.performance">
2
+ package="io.capawesome.capacitorjs.plugins.firebase.performance">
3
3
  </manifest>
@@ -1,4 +1,4 @@
1
- package dev.robingenz.capacitorjs.plugins.firebase.performance;
1
+ package io.capawesome.capacitorjs.plugins.firebase.performance;
2
2
 
3
3
  import com.google.firebase.perf.metrics.Trace;
4
4
  import java.util.HashMap;
@@ -31,11 +31,11 @@ public class FirebasePerformance {
31
31
  return null;
32
32
  }
33
33
 
34
- public void setPerformanceCollectionEnabled(Boolean enabled) {
34
+ public void setEnabled(Boolean enabled) {
35
35
  this.getFirebasePerformanceInstance().setPerformanceCollectionEnabled(enabled);
36
36
  }
37
37
 
38
- public Boolean isPerformanceCollectionEnabled() {
38
+ public Boolean isEnabled() {
39
39
  return this.getFirebasePerformanceInstance().isPerformanceCollectionEnabled();
40
40
  }
41
41
 
@@ -1,4 +1,4 @@
1
- package dev.robingenz.capacitorjs.plugins.firebase.performance;
1
+ package io.capawesome.capacitorjs.plugins.firebase.performance;
2
2
 
3
3
  import com.getcapacitor.JSObject;
4
4
  import com.getcapacitor.Plugin;
@@ -84,14 +84,14 @@ public class FirebasePerformancePlugin extends Plugin {
84
84
  }
85
85
 
86
86
  @PluginMethod
87
- public void setPerformanceCollectionEnabled(PluginCall call) {
87
+ public void setEnabled(PluginCall call) {
88
88
  try {
89
89
  Boolean enabled = call.getBoolean("enabled");
90
90
  if (enabled == null) {
91
91
  call.reject(ERROR_ENABLED_MISSING);
92
92
  return;
93
93
  }
94
- implementation.setPerformanceCollectionEnabled(enabled);
94
+ implementation.setEnabled(enabled);
95
95
  call.resolve();
96
96
  } catch (Exception ex) {
97
97
  call.reject(ex.getLocalizedMessage());
@@ -99,9 +99,9 @@ public class FirebasePerformancePlugin extends Plugin {
99
99
  }
100
100
 
101
101
  @PluginMethod
102
- public void isPerformanceCollectionEnabled(PluginCall call) {
102
+ public void isEnabled(PluginCall call) {
103
103
  try {
104
- Boolean enabled = implementation.isPerformanceCollectionEnabled();
104
+ Boolean enabled = implementation.isEnabled();
105
105
  JSObject result = new JSObject();
106
106
  result.put("enabled", enabled);
107
107
  call.resolve(result);
package/dist/docs.json CHANGED
@@ -75,13 +75,13 @@
75
75
  "slug": "incrementmetric"
76
76
  },
77
77
  {
78
- "name": "setPerformanceCollectionEnabled",
79
- "signature": "(options: SetPerformanceCollectionEnabledOptions) => Promise<void>",
78
+ "name": "setEnabled",
79
+ "signature": "(options: SetEnabledOptions) => Promise<void>",
80
80
  "parameters": [
81
81
  {
82
82
  "name": "options",
83
83
  "docs": "",
84
- "type": "SetPerformanceCollectionEnabledOptions"
84
+ "type": "SetEnabledOptions"
85
85
  }
86
86
  ],
87
87
  "returns": "Promise<void>",
@@ -93,15 +93,15 @@
93
93
  ],
94
94
  "docs": "Enables or disables performance monitoring.\nWill be applied with the next start of the app.",
95
95
  "complexTypes": [
96
- "SetPerformanceCollectionEnabledOptions"
96
+ "SetEnabledOptions"
97
97
  ],
98
- "slug": "setperformancecollectionenabled"
98
+ "slug": "setenabled"
99
99
  },
100
100
  {
101
- "name": "isPerformanceCollectionEnabled",
102
- "signature": "() => Promise<IsPerformanceCollectionEnabledResult>",
101
+ "name": "isEnabled",
102
+ "signature": "() => Promise<IsEnabledResult>",
103
103
  "parameters": [],
104
- "returns": "Promise<IsPerformanceCollectionEnabledResult>",
104
+ "returns": "Promise<IsEnabledResult>",
105
105
  "tags": [
106
106
  {
107
107
  "name": "since",
@@ -110,9 +110,9 @@
110
110
  ],
111
111
  "docs": "Determines whether performance monitoring is enabled or disabled.",
112
112
  "complexTypes": [
113
- "IsPerformanceCollectionEnabledResult"
113
+ "IsEnabledResult"
114
114
  ],
115
- "slug": "isperformancecollectionenabled"
115
+ "slug": "isenabled"
116
116
  }
117
117
  ],
118
118
  "properties": []
@@ -225,8 +225,8 @@
225
225
  ]
226
226
  },
227
227
  {
228
- "name": "SetPerformanceCollectionEnabledOptions",
229
- "slug": "setperformancecollectionenabledoptions",
228
+ "name": "SetEnabledOptions",
229
+ "slug": "setenabledoptions",
230
230
  "docs": "",
231
231
  "tags": [
232
232
  {
@@ -251,8 +251,8 @@
251
251
  ]
252
252
  },
253
253
  {
254
- "name": "IsPerformanceCollectionEnabledResult",
255
- "slug": "isperformancecollectionenabledresult",
254
+ "name": "IsEnabledResult",
255
+ "slug": "isenabledresult",
256
256
  "docs": "",
257
257
  "tags": [],
258
258
  "methods": [],
@@ -23,13 +23,13 @@ export interface FirebasePerformancePlugin {
23
23
  *
24
24
  * @since 0.1.0
25
25
  */
26
- setPerformanceCollectionEnabled(options: SetPerformanceCollectionEnabledOptions): Promise<void>;
26
+ setEnabled(options: SetEnabledOptions): Promise<void>;
27
27
  /**
28
28
  * Determines whether performance monitoring is enabled or disabled.
29
29
  *
30
30
  * @since 0.1.0
31
31
  */
32
- isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;
32
+ isEnabled(): Promise<IsEnabledResult>;
33
33
  }
34
34
  /**
35
35
  * @since 0.1.0
@@ -84,7 +84,7 @@ export interface IncrementMetricOptions {
84
84
  /**
85
85
  * @since 0.1.0
86
86
  */
87
- export interface SetPerformanceCollectionEnabledOptions {
87
+ export interface SetEnabledOptions {
88
88
  /**
89
89
  * Should performance monitoring be enabled.
90
90
  *
@@ -92,7 +92,7 @@ export interface SetPerformanceCollectionEnabledOptions {
92
92
  */
93
93
  enabled: boolean;
94
94
  }
95
- export interface IsPerformanceCollectionEnabledResult {
95
+ export interface IsEnabledResult {
96
96
  /**
97
97
  * `true` if performance monitoring is enabled, otherwise `false`.
98
98
  *
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface FirebasePerformancePlugin {\n /**\n * Starts a trace.\n *\n * @since 0.1.0\n */\n startTrace(options: StartTraceOptions): Promise<void>;\n /**\n * Stops a trace.\n *\n * @since 0.1.0\n */\n stopTrace(options: StopTraceOptions): Promise<void>;\n /**\n * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.\n *\n * @since 0.1.0\n */\n incrementMetric(options: IncrementMetricOptions): Promise<void>;\n /**\n * Enables or disables performance monitoring.\n * Will be applied with the next start of the app.\n *\n * @since 0.1.0\n */\n setPerformanceCollectionEnabled(\n options: SetPerformanceCollectionEnabledOptions,\n ): Promise<void>;\n /**\n * Determines whether performance monitoring is enabled or disabled.\n *\n * @since 0.1.0\n */\n isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StartTraceOptions {\n /**\n * Custom trace name.\n *\n * Names for custom code traces must meet the following requirements:\n * no leading or trailing whitespace, no leading underscore (_) character,\n * and max length is 100 characters.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StopTraceOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IncrementMetricOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n /**\n * Name of the metric to be incremented.\n *\n * @since 0.1.0\n */\n metricName: string;\n /**\n * Amount by which the metric has to be incremented.\n *\n * @default 1\n * @since 0.1.0\n */\n incrementBy?: number;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetPerformanceCollectionEnabledOptions {\n /**\n * Should performance monitoring be enabled.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n\nexport interface IsPerformanceCollectionEnabledResult {\n /**\n * `true` if performance monitoring is enabled, otherwise `false`.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface FirebasePerformancePlugin {\n /**\n * Starts a trace.\n *\n * @since 0.1.0\n */\n startTrace(options: StartTraceOptions): Promise<void>;\n /**\n * Stops a trace.\n *\n * @since 0.1.0\n */\n stopTrace(options: StopTraceOptions): Promise<void>;\n /**\n * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.\n *\n * @since 0.1.0\n */\n incrementMetric(options: IncrementMetricOptions): Promise<void>;\n /**\n * Enables or disables performance monitoring.\n * Will be applied with the next start of the app.\n *\n * @since 0.1.0\n */\n setEnabled(options: SetEnabledOptions): Promise<void>;\n /**\n * Determines whether performance monitoring is enabled or disabled.\n *\n * @since 0.1.0\n */\n isEnabled(): Promise<IsEnabledResult>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StartTraceOptions {\n /**\n * Custom trace name.\n *\n * Names for custom code traces must meet the following requirements:\n * no leading or trailing whitespace, no leading underscore (_) character,\n * and max length is 100 characters.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StopTraceOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IncrementMetricOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n /**\n * Name of the metric to be incremented.\n *\n * @since 0.1.0\n */\n metricName: string;\n /**\n * Amount by which the metric has to be incremented.\n *\n * @default 1\n * @since 0.1.0\n */\n incrementBy?: number;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetEnabledOptions {\n /**\n * Should performance monitoring be enabled.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n\nexport interface IsEnabledResult {\n /**\n * `true` if performance monitoring is enabled, otherwise `false`.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { FirebasePerformancePlugin, IncrementMetricOptions, IsPerformanceCollectionEnabledResult, SetPerformanceCollectionEnabledOptions, StartTraceOptions, StopTraceOptions } from './definitions';
2
+ import type { FirebasePerformancePlugin, IncrementMetricOptions, IsEnabledResult, SetEnabledOptions, StartTraceOptions, StopTraceOptions } from './definitions';
3
3
  export declare class FirebasePerformanceWeb extends WebPlugin implements FirebasePerformancePlugin {
4
4
  private traces;
5
5
  startTrace(options: StartTraceOptions): Promise<void>;
6
6
  stopTrace(options: StopTraceOptions): Promise<void>;
7
7
  incrementMetric(options: IncrementMetricOptions): Promise<void>;
8
- setPerformanceCollectionEnabled(options: SetPerformanceCollectionEnabledOptions): Promise<void>;
9
- isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;
8
+ setEnabled(options: SetEnabledOptions): Promise<void>;
9
+ isEnabled(): Promise<IsEnabledResult>;
10
10
  }
package/dist/esm/web.js CHANGED
@@ -25,12 +25,12 @@ export class FirebasePerformanceWeb extends WebPlugin {
25
25
  }
26
26
  trace.incrementMetric(options.metricName, options.incrementBy);
27
27
  }
28
- async setPerformanceCollectionEnabled(options) {
28
+ async setEnabled(options) {
29
29
  const perf = getPerformance();
30
30
  perf.instrumentationEnabled = options.enabled;
31
31
  perf.dataCollectionEnabled = options.enabled;
32
32
  }
33
- async isPerformanceCollectionEnabled() {
33
+ async isEnabled() {
34
34
  const perf = getPerformance();
35
35
  const result = {
36
36
  enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mapp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,cAAc,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAyC;YACnD,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;SACnE,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PerformanceTrace } from 'firebase/performance';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\n\nimport type {\n FirebasePerformancePlugin,\n IncrementMetricOptions,\n IsPerformanceCollectionEnabledResult,\n SetPerformanceCollectionEnabledOptions,\n StartTraceOptions,\n StopTraceOptions,\n} from './definitions';\n\nexport class FirebasePerformanceWeb\n extends WebPlugin\n implements FirebasePerformancePlugin {\n private traces: { [key: string]: PerformanceTrace | undefined } = {};\n\n public async startTrace(options: StartTraceOptions): Promise<void> {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n\n public async stopTrace(options: StopTraceOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n\n public async incrementMetric(options: IncrementMetricOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n\n public async setPerformanceCollectionEnabled(\n options: SetPerformanceCollectionEnabledOptions,\n ): Promise<void> {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n\n public async isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult> {\n const perf = getPerformance();\n const result: IsPerformanceCollectionEnabledResult = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,K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I,CAAC,qBAAqB;SACnE,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PerformanceTrace } from 'firebase/performance';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\n\nimport type {\n FirebasePerformancePlugin,\n IncrementMetricOptions,\n IsEnabledResult,\n SetEnabledOptions,\n StartTraceOptions,\n StopTraceOptions,\n} from './definitions';\n\nexport class FirebasePerformanceWeb\n extends WebPlugin\n implements FirebasePerformancePlugin\n{\n private traces: { [key: string]: PerformanceTrace | undefined } = {};\n\n public async startTrace(options: StartTraceOptions): Promise<void> {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n\n public async stopTrace(options: StopTraceOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n\n public async incrementMetric(options: IncrementMetricOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n\n public async setEnabled(options: SetEnabledOptions): Promise<void> {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n\n public async isEnabled(): Promise<IsEnabledResult> {\n const perf = getPerformance();\n const result: IsEnabledResult = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n"]}
@@ -34,12 +34,12 @@ class FirebasePerformanceWeb extends core.WebPlugin {
34
34
  }
35
35
  trace.incrementMetric(options.metricName, options.incrementBy);
36
36
  }
37
- async setPerformanceCollectionEnabled(options) {
37
+ async setEnabled(options) {
38
38
  const perf = performance.getPerformance();
39
39
  perf.instrumentationEnabled = options.enabled;
40
40
  perf.dataCollectionEnabled = options.enabled;
41
41
  }
42
- async isPerformanceCollectionEnabled() {
42
+ async isEnabled() {
43
43
  const perf = performance.getPerformance();
44
44
  const result = {
45
45
  enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setPerformanceCollectionEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isPerformanceCollectionEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;AAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;AACxE,CAAC;;ACDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;AACtD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EA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AG;AACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;AAC9E,SAAS,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;AAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;AACxE,CAAC;;ACDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;AACtD,IAAI,WAAW,GAAG;AAClB,QAAQ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QAAQ,MAAM,IAAI,GAAGA,0BAAc,EAAE,CAAC;AACtC,QAAQ,MAAM,MAAM,GAAG;AACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;AAC9E,SAAS,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -30,12 +30,12 @@ var capacitorFirebasePerformance = (function (exports, core, performance) {
30
30
  }
31
31
  trace.incrementMetric(options.metricName, options.incrementBy);
32
32
  }
33
- async setPerformanceCollectionEnabled(options) {
33
+ async setEnabled(options) {
34
34
  const perf = performance.getPerformance();
35
35
  perf.instrumentationEnabled = options.enabled;
36
36
  perf.dataCollectionEnabled = options.enabled;
37
37
  }
38
- async isPerformanceCollectionEnabled() {
38
+ async isEnabled() {
39
39
  const perf = performance.getPerformance();
40
40
  const result = {
41
41
  enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
@@ -55,5 +55,5 @@ var capacitorFirebasePerformance = (function (exports, core, performance) {
55
55
 
56
56
  return exports;
57
57
 
58
- }({}, capacitorExports, firebasePerformanceExports));
58
+ })({}, capacitorExports, firebasePerformanceExports);
59
59
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setPerformanceCollectionEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isPerformanceCollectionEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IACxE,CAAC;;ICDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACzB,KAAK;IACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,GAAGC,0BAAc,EAAE,CAAC;IACtC,QAAQ,MAAM,KAAK,GAAGC,iBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3D,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC/C,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;IACpB,YAAY,OAAO;IACnB,SAAS;IACT,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,KAAK;IACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;IACnC,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;IACpB,YAAY,OAAO;IACnB,SAAS;IACT,QAAQ,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACvE,KAAK;IACL,IAAI,MAAM,+BAA+B,CAAC,OAAO,EAAE;IACnD,QAAQ,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;IACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IACrD,KAAK;IACL,IAAI,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,MAAM,IAAI,GAAGA,0BAAc,EAAE,CAAC;IACtC,QAAQ,MAAM,MAAM,GAAG;IACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;IAC9E,SAAS,CAAC;IACV,QAAQ,OAAO,MAAM,CAAC;IACtB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IACxE,CAAC;;ICDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACzB,KAAK;IACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,GAAGC,0BAAc,EAAE,CAAC;IACtC,QAAQ,MAAM,KAAK,GAAGC,iBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3D,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC/C,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;IACpB,YAAY,OAAO;IACnB,SAAS;IACT,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,KAAK;IACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;IACnC,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;IACpB,YAAY,OAAO;IACnB,SAAS;IACT,QAAQ,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACvE,KAAK;IACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;IACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IACrD,KAAK;IACL,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,GAAGA,0BAAc,EAAE,CAAC;IACtC,QAAQ,MAAM,MAAM,GAAG;IACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;IAC9E,SAAS,CAAC;IACV,QAAQ,OAAO,MAAM,CAAC;IACtB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
@@ -36,11 +36,11 @@ import FirebasePerformance
36
36
  return self.traces[traceName]
37
37
  }
38
38
 
39
- @objc public func setPerformanceCollectionEnabled(_ enabled: Bool) {
39
+ @objc public func setEnabled(_ enabled: Bool) {
40
40
  Performance.sharedInstance().isDataCollectionEnabled = enabled
41
41
  }
42
42
 
43
- @objc public func isPerformanceCollectionEnabled() -> Bool {
43
+ @objc public func isEnabled() -> Bool {
44
44
  return Performance.sharedInstance().isDataCollectionEnabled
45
45
  }
46
46
  }
@@ -7,6 +7,6 @@ CAP_PLUGIN(FirebasePerformancePlugin, "FirebasePerformance",
7
7
  CAP_PLUGIN_METHOD(startTrace, CAPPluginReturnPromise);
8
8
  CAP_PLUGIN_METHOD(stopTrace, CAPPluginReturnPromise);
9
9
  CAP_PLUGIN_METHOD(incrementMetric, CAPPluginReturnPromise);
10
- CAP_PLUGIN_METHOD(setPerformanceCollectionEnabled, CAPPluginReturnPromise);
11
- CAP_PLUGIN_METHOD(isPerformanceCollectionEnabled, CAPPluginReturnPromise);
10
+ CAP_PLUGIN_METHOD(setEnabled, CAPPluginReturnPromise);
11
+ CAP_PLUGIN_METHOD(isEnabled, CAPPluginReturnPromise);
12
12
  )
@@ -65,17 +65,17 @@ public class FirebasePerformancePlugin: CAPPlugin {
65
65
  call.resolve()
66
66
  }
67
67
 
68
- @objc func setPerformanceCollectionEnabled(_ call: CAPPluginCall) {
68
+ @objc func setEnabled(_ call: CAPPluginCall) {
69
69
  guard let enabled = call.getBool("enabled") else {
70
70
  call.reject(errorEnabledMissing)
71
71
  return
72
72
  }
73
- implementation?.setPerformanceCollectionEnabled(enabled)
73
+ implementation?.setEnabled(enabled)
74
74
  call.resolve()
75
75
  }
76
76
 
77
- @objc func isPerformanceCollectionEnabled(_ call: CAPPluginCall) {
78
- let enabled = implementation?.isPerformanceCollectionEnabled()
77
+ @objc func isEnabled(_ call: CAPPluginCall) {
78
+ let enabled = implementation?.isEnabled()
79
79
  var result = JSObject()
80
80
  result["enabled"] = enabled
81
81
  call.resolve(result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-firebase/performance",
3
- "version": "0.5.1",
3
+ "version": "1.0.0",
4
4
  "description": "Capacitor plugin for Firebase Performance Monitoring.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "scripts": {
42
42
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
43
- "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
43
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
44
44
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
45
45
  "verify:web": "npm run build",
46
46
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
@@ -55,25 +55,25 @@
55
55
  "prepublishOnly": "npm run build"
56
56
  },
57
57
  "devDependencies": {
58
- "@capacitor/android": "3.4.0",
59
- "@capacitor/cli": "3.4.0",
60
- "@capacitor/core": "3.4.0",
61
- "@capacitor/docgen": "0.0.18",
62
- "@capacitor/ios": "3.4.0",
58
+ "@capacitor/android": "4.0.1",
59
+ "@capacitor/cli": "4.0.1",
60
+ "@capacitor/core": "4.0.1",
61
+ "@capacitor/docgen": "0.2.0",
62
+ "@capacitor/ios": "4.0.1",
63
63
  "@ionic/eslint-config": "0.3.0",
64
64
  "@ionic/prettier-config": "1.0.1",
65
65
  "@ionic/swiftlint-config": "1.1.2",
66
- "eslint": "7.11.0",
66
+ "eslint": "7.32.0",
67
67
  "firebase": "9.6.4",
68
- "prettier": "2.2.0",
69
- "prettier-plugin-java": "1.0.0",
68
+ "prettier": "2.3.2",
69
+ "prettier-plugin-java": "1.0.2",
70
70
  "rimraf": "3.0.2",
71
- "rollup": "2.32.0",
71
+ "rollup": "2.77.2",
72
72
  "swiftlint": "1.0.1",
73
- "typescript": "4.0.3"
73
+ "typescript": "4.1.5"
74
74
  },
75
75
  "peerDependencies": {
76
- "@capacitor/core": "^3.0.0",
76
+ "@capacitor/core": "^4.0.0",
77
77
  "firebase": "^9.0.0"
78
78
  },
79
79
  "prettier": "@ionic/prettier-config",