@capacitor-firebase/performance 0.5.1-dev.01021f0.1659726888 → 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.
@@ -1,83 +1,83 @@
1
- import Foundation
2
- import Capacitor
3
-
4
- /**
5
- * Please read the Capacitor iOS Plugin Development Guide
6
- * here: https://capacitorjs.com/docs/plugins/ios
7
- */
8
- @objc(FirebasePerformancePlugin)
9
- public class FirebasePerformancePlugin: CAPPlugin {
10
- public let errorTraceNameMissing = "traceName must be provided."
11
- public let errorMetricNameMissing = "metricName must be provided."
12
- public let errorEnabledMissing = "enabled must be provided."
13
- public let errorTraceNameAlreadyAssigned = "traceName already assigned."
14
- public let errorTraceNotFound = "No trace was found with the provided traceName."
15
- private var implementation: FirebasePerformance?
16
-
17
- override public func load() {
18
- implementation = FirebasePerformance()
19
- }
20
-
21
- @objc func startTrace(_ call: CAPPluginCall) {
22
- guard let traceName = call.getString("traceName") else {
23
- call.reject(errorTraceNameMissing)
24
- return
25
- }
26
- let trace = implementation?.getTraceByName(traceName)
27
- guard trace == nil else {
28
- call.reject(errorTraceNameAlreadyAssigned)
29
- return
30
- }
31
- implementation?.startTrace(traceName)
32
- call.resolve()
33
- }
34
-
35
- @objc func stopTrace(_ call: CAPPluginCall) {
36
- guard let traceName = call.getString("traceName") else {
37
- call.reject(errorTraceNameMissing)
38
- return
39
- }
40
- let trace = implementation?.getTraceByName(traceName)
41
- guard trace != nil else {
42
- call.reject(errorTraceNotFound)
43
- return
44
- }
45
- implementation?.stopTrace(traceName)
46
- call.resolve()
47
- }
48
-
49
- @objc func incrementMetric(_ call: CAPPluginCall) {
50
- guard let traceName = call.getString("traceName") else {
51
- call.reject(errorTraceNameMissing)
52
- return
53
- }
54
- guard let metricName = call.getString("metricName") else {
55
- call.reject(errorMetricNameMissing)
56
- return
57
- }
58
- let trace = implementation?.getTraceByName(traceName)
59
- guard trace != nil else {
60
- call.reject(errorTraceNotFound)
61
- return
62
- }
63
- let incrementBy = call.getInt("incrementBy") ?? 1
64
- implementation?.incrementMetric(traceName, metricName, incrementBy)
65
- call.resolve()
66
- }
67
-
68
- @objc func setEnabled(_ call: CAPPluginCall) {
69
- guard let enabled = call.getBool("enabled") else {
70
- call.reject(errorEnabledMissing)
71
- return
72
- }
73
- implementation?.setEnabled(enabled)
74
- call.resolve()
75
- }
76
-
77
- @objc func isEnabled(_ call: CAPPluginCall) {
78
- let enabled = implementation?.isEnabled()
79
- var result = JSObject()
80
- result["enabled"] = enabled
81
- call.resolve(result)
82
- }
83
- }
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ /**
5
+ * Please read the Capacitor iOS Plugin Development Guide
6
+ * here: https://capacitorjs.com/docs/plugins/ios
7
+ */
8
+ @objc(FirebasePerformancePlugin)
9
+ public class FirebasePerformancePlugin: CAPPlugin {
10
+ public let errorTraceNameMissing = "traceName must be provided."
11
+ public let errorMetricNameMissing = "metricName must be provided."
12
+ public let errorEnabledMissing = "enabled must be provided."
13
+ public let errorTraceNameAlreadyAssigned = "traceName already assigned."
14
+ public let errorTraceNotFound = "No trace was found with the provided traceName."
15
+ private var implementation: FirebasePerformance?
16
+
17
+ override public func load() {
18
+ implementation = FirebasePerformance()
19
+ }
20
+
21
+ @objc func startTrace(_ call: CAPPluginCall) {
22
+ guard let traceName = call.getString("traceName") else {
23
+ call.reject(errorTraceNameMissing)
24
+ return
25
+ }
26
+ let trace = implementation?.getTraceByName(traceName)
27
+ guard trace == nil else {
28
+ call.reject(errorTraceNameAlreadyAssigned)
29
+ return
30
+ }
31
+ implementation?.startTrace(traceName)
32
+ call.resolve()
33
+ }
34
+
35
+ @objc func stopTrace(_ call: CAPPluginCall) {
36
+ guard let traceName = call.getString("traceName") else {
37
+ call.reject(errorTraceNameMissing)
38
+ return
39
+ }
40
+ let trace = implementation?.getTraceByName(traceName)
41
+ guard trace != nil else {
42
+ call.reject(errorTraceNotFound)
43
+ return
44
+ }
45
+ implementation?.stopTrace(traceName)
46
+ call.resolve()
47
+ }
48
+
49
+ @objc func incrementMetric(_ call: CAPPluginCall) {
50
+ guard let traceName = call.getString("traceName") else {
51
+ call.reject(errorTraceNameMissing)
52
+ return
53
+ }
54
+ guard let metricName = call.getString("metricName") else {
55
+ call.reject(errorMetricNameMissing)
56
+ return
57
+ }
58
+ let trace = implementation?.getTraceByName(traceName)
59
+ guard trace != nil else {
60
+ call.reject(errorTraceNotFound)
61
+ return
62
+ }
63
+ let incrementBy = call.getInt("incrementBy") ?? 1
64
+ implementation?.incrementMetric(traceName, metricName, incrementBy)
65
+ call.resolve()
66
+ }
67
+
68
+ @objc func setEnabled(_ call: CAPPluginCall) {
69
+ guard let enabled = call.getBool("enabled") else {
70
+ call.reject(errorEnabledMissing)
71
+ return
72
+ }
73
+ implementation?.setEnabled(enabled)
74
+ call.resolve()
75
+ }
76
+
77
+ @objc func isEnabled(_ call: CAPPluginCall) {
78
+ let enabled = implementation?.isEnabled()
79
+ var result = JSObject()
80
+ result["enabled"] = enabled
81
+ call.resolve(result)
82
+ }
83
+ }
@@ -1,24 +1,24 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>$(DEVELOPMENT_LANGUAGE)</string>
7
- <key>CFBundleExecutable</key>
8
- <string>$(EXECUTABLE_NAME)</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>$(PRODUCT_NAME)</string>
15
- <key>CFBundlePackageType</key>
16
- <string>FMWK</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>1.0</string>
19
- <key>CFBundleVersion</key>
20
- <string>$(CURRENT_PROJECT_VERSION)</string>
21
- <key>NSPrincipalClass</key>
22
- <string></string>
23
- </dict>
24
- </plist>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>FMWK</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>$(CURRENT_PROJECT_VERSION)</string>
21
+ <key>NSPrincipalClass</key>
22
+ <string></string>
23
+ </dict>
24
+ </plist>
package/package.json CHANGED
@@ -1,95 +1,95 @@
1
- {
2
- "name": "@capacitor-firebase/performance",
3
- "version": "0.5.1-dev.01021f0.1659726888",
4
- "description": "Capacitor plugin for Firebase Performance Monitoring.",
5
- "main": "dist/plugin.cjs.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/esm/index.d.ts",
8
- "unpkg": "dist/plugin.js",
9
- "files": [
10
- "android/src/main/",
11
- "android/build.gradle",
12
- "dist/",
13
- "ios/Plugin/",
14
- "CapacitorFirebasePerformance.podspec"
15
- ],
16
- "author": "Robin Genz <mail@robingenz.dev>",
17
- "license": "Apache-2.0",
18
- "homepage": "https://capawesome.io/",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/capawesome-team/capacitor-firebase.git"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/capawesome-team/capacitor-firebase/issues"
25
- },
26
- "funding": [
27
- {
28
- "type": "github",
29
- "url": "https://github.com/sponsors/capawesome-team/"
30
- },
31
- {
32
- "type": "opencollective",
33
- "url": "https://opencollective.com/capawesome"
34
- }
35
- ],
36
- "keywords": [
37
- "capacitor",
38
- "plugin",
39
- "native"
40
- ],
41
- "scripts": {
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 -destination generic/platform=iOS && cd ..",
44
- "verify:android": "cd android && ./gradlew clean build test && cd ..",
45
- "verify:web": "npm run build",
46
- "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
47
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
48
- "eslint": "eslint . --ext ts",
49
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
50
- "swiftlint": "node-swiftlint",
51
- "docgen": "docgen --api FirebasePerformancePlugin --output-readme README.md --output-json dist/docs.json",
52
- "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
53
- "clean": "rimraf ./dist",
54
- "watch": "tsc --watch",
55
- "prepublishOnly": "npm run build"
56
- },
57
- "devDependencies": {
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
- "@ionic/eslint-config": "0.3.0",
64
- "@ionic/prettier-config": "1.0.1",
65
- "@ionic/swiftlint-config": "1.1.2",
66
- "eslint": "7.32.0",
67
- "firebase": "9.6.4",
68
- "prettier": "2.3.2",
69
- "prettier-plugin-java": "1.0.2",
70
- "rimraf": "3.0.2",
71
- "rollup": "2.77.2",
72
- "swiftlint": "1.0.1",
73
- "typescript": "4.1.5"
74
- },
75
- "peerDependencies": {
76
- "@capacitor/core": "^4.0.0",
77
- "firebase": "^9.0.0"
78
- },
79
- "prettier": "@ionic/prettier-config",
80
- "swiftlint": "@ionic/swiftlint-config",
81
- "eslintConfig": {
82
- "extends": "@ionic/eslint-config/recommended"
83
- },
84
- "capacitor": {
85
- "ios": {
86
- "src": "ios"
87
- },
88
- "android": {
89
- "src": "android"
90
- }
91
- },
92
- "publishConfig": {
93
- "access": "public"
94
- }
95
- }
1
+ {
2
+ "name": "@capacitor-firebase/performance",
3
+ "version": "1.0.0",
4
+ "description": "Capacitor plugin for Firebase Performance Monitoring.",
5
+ "main": "dist/plugin.cjs.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "unpkg": "dist/plugin.js",
9
+ "files": [
10
+ "android/src/main/",
11
+ "android/build.gradle",
12
+ "dist/",
13
+ "ios/Plugin/",
14
+ "CapacitorFirebasePerformance.podspec"
15
+ ],
16
+ "author": "Robin Genz <mail@robingenz.dev>",
17
+ "license": "Apache-2.0",
18
+ "homepage": "https://capawesome.io/",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/capawesome-team/capacitor-firebase.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/capawesome-team/capacitor-firebase/issues"
25
+ },
26
+ "funding": [
27
+ {
28
+ "type": "github",
29
+ "url": "https://github.com/sponsors/capawesome-team/"
30
+ },
31
+ {
32
+ "type": "opencollective",
33
+ "url": "https://opencollective.com/capawesome"
34
+ }
35
+ ],
36
+ "keywords": [
37
+ "capacitor",
38
+ "plugin",
39
+ "native"
40
+ ],
41
+ "scripts": {
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 -destination generic/platform=iOS && cd ..",
44
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
45
+ "verify:web": "npm run build",
46
+ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
47
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
48
+ "eslint": "eslint . --ext ts",
49
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
50
+ "swiftlint": "node-swiftlint",
51
+ "docgen": "docgen --api FirebasePerformancePlugin --output-readme README.md --output-json dist/docs.json",
52
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
53
+ "clean": "rimraf ./dist",
54
+ "watch": "tsc --watch",
55
+ "prepublishOnly": "npm run build"
56
+ },
57
+ "devDependencies": {
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
+ "@ionic/eslint-config": "0.3.0",
64
+ "@ionic/prettier-config": "1.0.1",
65
+ "@ionic/swiftlint-config": "1.1.2",
66
+ "eslint": "7.32.0",
67
+ "firebase": "9.6.4",
68
+ "prettier": "2.3.2",
69
+ "prettier-plugin-java": "1.0.2",
70
+ "rimraf": "3.0.2",
71
+ "rollup": "2.77.2",
72
+ "swiftlint": "1.0.1",
73
+ "typescript": "4.1.5"
74
+ },
75
+ "peerDependencies": {
76
+ "@capacitor/core": "^4.0.0",
77
+ "firebase": "^9.0.0"
78
+ },
79
+ "prettier": "@ionic/prettier-config",
80
+ "swiftlint": "@ionic/swiftlint-config",
81
+ "eslintConfig": {
82
+ "extends": "@ionic/eslint-config/recommended"
83
+ },
84
+ "capacitor": {
85
+ "ios": {
86
+ "src": "ios"
87
+ },
88
+ "android": {
89
+ "src": "android"
90
+ }
91
+ },
92
+ "publishConfig": {
93
+ "access": "public"
94
+ }
95
+ }