@capacitor-firebase/performance 1.4.0 → 5.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.
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '13.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'Firebase/Performance', '10.2.0'
16
+ s.dependency 'FirebasePerformance', '10.8.0'
17
17
  s.swift_version = '5.1'
18
18
  s.static_framework = true
19
19
  end
package/README.md CHANGED
@@ -19,7 +19,7 @@ See [Add the Performance Monitoring plugin to your app](https://firebase.google.
19
19
 
20
20
  This plugin will use the following project variables (defined in your app’s `variables.gradle` file):
21
21
 
22
- - `$firebasePerfVersion` version of `com.google.firebase:firebase-perf` (default: `20.3.0`)
22
+ - `$firebasePerfVersion` version of `com.google.firebase:firebase-perf` (default: `20.3.1`)
23
23
 
24
24
  ## Configuration
25
25
 
@@ -1,9 +1,9 @@
1
1
  ext {
2
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
- firebasePerfVersion = project.hasProperty('firebasePerfVersion') ? rootProject.ext.firebasePerfVersion : '20.3.0'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
6
+ firebasePerfVersion = project.hasProperty('firebasePerfVersion') ? rootProject.ext.firebasePerfVersion : '20.3.1'
7
7
  }
8
8
 
9
9
  buildscript {
@@ -12,17 +12,18 @@ buildscript {
12
12
  mavenCentral()
13
13
  }
14
14
  dependencies {
15
- classpath 'com.android.tools.build:gradle:7.2.1'
15
+ classpath 'com.android.tools.build:gradle:8.0.0'
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 : 32
22
+ namespace "io.capawesome.capacitorjs.plugins.firebase.performance"
23
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
23
24
  defaultConfig {
24
25
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
25
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
26
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
26
27
  versionCode 1
27
28
  versionName "1.0"
28
29
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -37,8 +38,8 @@ android {
37
38
  abortOnError false
38
39
  }
39
40
  compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_11
41
- targetCompatibility JavaVersion.VERSION_11
41
+ sourceCompatibility JavaVersion.VERSION_17
42
+ targetCompatibility JavaVersion.VERSION_17
42
43
  }
43
44
  }
44
45
 
@@ -1,3 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="io.capawesome.capacitorjs.plugins.firebase.performance">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
  </manifest>
@@ -1,6 +1,7 @@
1
1
  package io.capawesome.capacitorjs.plugins.firebase.performance;
2
2
 
3
3
  import com.getcapacitor.JSObject;
4
+ import com.getcapacitor.Logger;
4
5
  import com.getcapacitor.Plugin;
5
6
  import com.getcapacitor.PluginCall;
6
7
  import com.getcapacitor.PluginMethod;
@@ -10,6 +11,7 @@ import com.google.firebase.perf.metrics.Trace;
10
11
  @CapacitorPlugin(name = "FirebasePerformance")
11
12
  public class FirebasePerformancePlugin extends Plugin {
12
13
 
14
+ public static final String TAG = "FirebasePerformance";
13
15
  public static final String ERROR_TRACE_NAME_MISSING = "traceName must be provided.";
14
16
  public static final String ERROR_METRIC_NAME_MISSING = "metricName must be provided.";
15
17
  public static final String ERROR_TRACE_NAME_ALREADY_ASSIGNED = "traceName already assigned.";
@@ -32,8 +34,9 @@ public class FirebasePerformancePlugin extends Plugin {
32
34
  }
33
35
  implementation.startTrace(traceName);
34
36
  call.resolve();
35
- } catch (Exception ex) {
36
- call.reject(ex.getLocalizedMessage());
37
+ } catch (Exception exception) {
38
+ Logger.error(TAG, exception.getMessage(), exception);
39
+ call.reject(exception.getMessage());
37
40
  }
38
41
  }
39
42
 
@@ -52,8 +55,9 @@ public class FirebasePerformancePlugin extends Plugin {
52
55
  }
53
56
  implementation.stopTrace(traceName);
54
57
  call.resolve();
55
- } catch (Exception ex) {
56
- call.reject(ex.getLocalizedMessage());
58
+ } catch (Exception exception) {
59
+ Logger.error(TAG, exception.getMessage(), exception);
60
+ call.reject(exception.getMessage());
57
61
  }
58
62
  }
59
63
 
@@ -78,8 +82,9 @@ public class FirebasePerformancePlugin extends Plugin {
78
82
  }
79
83
  implementation.incrementMetric(traceName, metricName, incrementBy);
80
84
  call.resolve();
81
- } catch (Exception ex) {
82
- call.reject(ex.getLocalizedMessage());
85
+ } catch (Exception exception) {
86
+ Logger.error(TAG, exception.getMessage(), exception);
87
+ call.reject(exception.getMessage());
83
88
  }
84
89
  }
85
90
 
@@ -93,8 +98,9 @@ public class FirebasePerformancePlugin extends Plugin {
93
98
  }
94
99
  implementation.setEnabled(enabled);
95
100
  call.resolve();
96
- } catch (Exception ex) {
97
- call.reject(ex.getLocalizedMessage());
101
+ } catch (Exception exception) {
102
+ Logger.error(TAG, exception.getMessage(), exception);
103
+ call.reject(exception.getMessage());
98
104
  }
99
105
  }
100
106
 
@@ -105,8 +111,9 @@ public class FirebasePerformancePlugin extends Plugin {
105
111
  JSObject result = new JSObject();
106
112
  result.put("enabled", enabled);
107
113
  call.resolve(result);
108
- } catch (Exception ex) {
109
- call.reject(ex.getLocalizedMessage());
114
+ } catch (Exception exception) {
115
+ Logger.error(TAG, exception.getMessage(), exception);
116
+ call.reject(exception.getMessage());
110
117
  }
111
118
  }
112
119
  }
package/dist/esm/web.js CHANGED
@@ -17,6 +17,7 @@ export class FirebasePerformanceWeb extends WebPlugin {
17
17
  return;
18
18
  }
19
19
  trace.stop();
20
+ delete this.traces[options.traceName];
20
21
  }
21
22
  async incrementMetric(options) {
22
23
  const trace = this.traces[options.traceName];
@@ -1 +1 @@
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,KAAK,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW5E,MAAM,OAAO,sBACX,SAAQ,SAAS;IADnB;;QAIU,WAAM,GAAoD,EAAE,CAAC;IAsCvE,CAAC;IApCQ,KAAK,CAAC,UAAU,CAAC,OAA0B;QAChD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAAyB;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,IAAI,EAAE,CAAC;IACf,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAA+B;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,OAA0B;QAChD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;QAC9C,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,SAAS;QACpB,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAoB;YAC9B,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 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"]}
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,KAAK,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW5E,MAAM,OAAO,sBACX,SAAQ,SAAS;IADnB;;QAIU,WAAM,GAAoD,EAAE,CAAC;IAuCvE,CAAC;IArCQ,KAAK,CAAC,UAAU,CAAC,OAA0B;QAChD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAAyB;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAA+B;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,OAA0B;QAChD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;QAC9C,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,SAAS;QACpB,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAoB;YAC9B,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 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 delete this.traces[options.traceName];\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"]}
@@ -26,6 +26,7 @@ class FirebasePerformanceWeb extends core.WebPlugin {
26
26
  return;
27
27
  }
28
28
  trace.stop();
29
+ delete this.traces[options.traceName];
29
30
  }
30
31
  async incrementMetric(options) {
31
32
  const trace = this.traces[options.traceName];
@@ -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 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":["register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AAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;AACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;AACrD,KAAK;AACL,IAAI,MAAM,SAAS,GAAG;AACtB,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;;;;;;;;;"}
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 delete this.traces[options.traceName];\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,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAGC,0BAAc,EAAE,CAAC;AACtC,QAAQ,MAAM,KAAK,GAAGC,iBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;AAC3D,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;AACtB,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;AAC/C,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;AACrB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC9C,KAAK;AACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;AACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;AACrD,KAAK;AACL,IAAI,MAAM,SAAS,GAAG;AACtB,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
@@ -22,6 +22,7 @@ var capacitorFirebasePerformance = (function (exports, core, performance) {
22
22
  return;
23
23
  }
24
24
  trace.stop();
25
+ delete this.traces[options.traceName];
25
26
  }
26
27
  async incrementMetric(options) {
27
28
  const trace = this.traces[options.traceName];
@@ -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 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;;;;;;;;;;;;;;;;;"}
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 delete this.traces[options.traceName];\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,IAA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capacitor plugin for Firebase Performance Monitoring.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -52,19 +52,19 @@
52
52
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
53
53
  "clean": "rimraf ./dist",
54
54
  "watch": "tsc --watch",
55
+ "ios:pod:install": "cd ios && pod install --repo-update && cd ..",
55
56
  "prepublishOnly": "npm run build"
56
57
  },
57
58
  "devDependencies": {
58
- "@capacitor/android": "4.0.1",
59
- "@capacitor/cli": "4.0.1",
60
- "@capacitor/core": "4.0.1",
59
+ "@capacitor/android": "5.0.0",
60
+ "@capacitor/cli": "5.0.0",
61
+ "@capacitor/core": "5.0.0",
61
62
  "@capacitor/docgen": "0.2.1",
62
- "@capacitor/ios": "4.0.1",
63
+ "@capacitor/ios": "5.0.0",
63
64
  "@ionic/eslint-config": "0.3.0",
64
- "@ionic/prettier-config": "1.0.1",
65
65
  "@ionic/swiftlint-config": "1.1.2",
66
66
  "eslint": "7.32.0",
67
- "firebase": "9.6.4",
67
+ "firebase": "9.20.0",
68
68
  "prettier": "2.3.2",
69
69
  "prettier-plugin-java": "1.0.2",
70
70
  "rimraf": "3.0.2",
@@ -73,7 +73,7 @@
73
73
  "typescript": "4.1.5"
74
74
  },
75
75
  "peerDependencies": {
76
- "@capacitor/core": "^4.0.0",
76
+ "@capacitor/core": "^5.0.0",
77
77
  "firebase": "^9.0.0"
78
78
  },
79
79
  "peerDependenciesMeta": {
@@ -81,7 +81,6 @@
81
81
  "optional": true
82
82
  }
83
83
  },
84
- "prettier": "@ionic/prettier-config",
85
84
  "swiftlint": "@ionic/swiftlint-config",
86
85
  "eslintConfig": {
87
86
  "extends": "@ionic/eslint-config/recommended"