mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat: add analytics-firebase plugin
This commit is contained in:
parent
8e405cc3d3
commit
e374b52c59
78
package-lock.json
generated
78
package-lock.json
generated
@ -3565,6 +3565,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "~2.0.0"
|
"inherits": "~2.0.0"
|
||||||
}
|
}
|
||||||
@ -3592,7 +3593,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=",
|
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"caseless": {
|
"caseless": {
|
||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
@ -3612,13 +3614,15 @@
|
|||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
|
"integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
}
|
}
|
||||||
@ -3633,19 +3637,22 @@
|
|||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"cryptiles": {
|
"cryptiles": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
|
"integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"boom": "2.x.x"
|
"boom": "2.x.x"
|
||||||
}
|
}
|
||||||
@ -3690,7 +3697,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"delegates": {
|
"delegates": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@ -3727,7 +3735,8 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=",
|
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"forever-agent": {
|
"forever-agent": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
@ -3864,6 +3873,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
|
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"boom": "2.x.x",
|
"boom": "2.x.x",
|
||||||
"cryptiles": "2.x.x",
|
"cryptiles": "2.x.x",
|
||||||
@ -3917,6 +3927,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -3932,7 +3943,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"isstream": {
|
"isstream": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
@ -4015,13 +4027,15 @@
|
|||||||
"version": "1.27.0",
|
"version": "1.27.0",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=",
|
"integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.15",
|
"version": "2.1.15",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=",
|
"integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "~1.27.0"
|
"mime-db": "~1.27.0"
|
||||||
}
|
}
|
||||||
@ -4105,7 +4119,8 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"oauth-sign": {
|
"oauth-sign": {
|
||||||
"version": "0.8.2",
|
"version": "0.8.2",
|
||||||
@ -4172,7 +4187,8 @@
|
|||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
|
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"punycode": {
|
"punycode": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
@ -4215,6 +4231,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=",
|
"integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"buffer-shims": "~1.0.0",
|
"buffer-shims": "~1.0.0",
|
||||||
"core-util-is": "~1.0.0",
|
"core-util-is": "~1.0.0",
|
||||||
@ -4269,7 +4286,8 @@
|
|||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=",
|
"integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.3.0",
|
"version": "5.3.0",
|
||||||
@ -4297,6 +4315,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
|
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"hoek": "2.x.x"
|
"hoek": "2.x.x"
|
||||||
}
|
}
|
||||||
@ -4333,6 +4352,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
@ -4344,6 +4364,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
|
"integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.0.1"
|
"safe-buffer": "^5.0.1"
|
||||||
}
|
}
|
||||||
@ -4376,6 +4397,7 @@
|
|||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"block-stream": "*",
|
"block-stream": "*",
|
||||||
"fstream": "^1.0.2",
|
"fstream": "^1.0.2",
|
||||||
@ -4437,7 +4459,8 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": false,
|
"resolved": false,
|
||||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
@ -9486,12 +9509,14 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -9511,7 +9536,8 @@
|
|||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
@ -9659,6 +9685,7 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -12367,12 +12394,14 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -12387,17 +12416,20 @@
|
|||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -12514,7 +12546,8 @@
|
|||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@ -12526,6 +12559,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -12540,6 +12574,7 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -12651,7 +12686,8 @@
|
|||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@ -12663,6 +12699,7 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@ -12784,6 +12821,7 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
|
248
src/@ionic-native/plugins/analytics-firebase/index.ts
Normal file
248
src/@ionic-native/plugins/analytics-firebase/index.ts
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Analytics Firebase
|
||||||
|
* @description
|
||||||
|
* Google Analytics Firebase plugin for Ionic Native apps.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { AnalyticsFirebase } from '@ionic-native/analytics-firebase';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private analyticsFirebase: AnalyticsFirebase) { }
|
||||||
|
*
|
||||||
|
* // Track an event with default events and params
|
||||||
|
* const eventParams = {};
|
||||||
|
* eventParams[this.analyticsFirebase.DEFAULT_PARAMS.LEVEL] = 29;
|
||||||
|
* this.analyticsFirebase.logEvent(this.analyticsFirebase.DEFAULT_EVENTS.LEVEL_UP, eventParams)
|
||||||
|
* .then(() => console.log('Event successfully tracked'))
|
||||||
|
* .catch(err => console.log('Error tracking event:', err));
|
||||||
|
*
|
||||||
|
* // Track an event with custom events and params
|
||||||
|
* const eventParams = {};
|
||||||
|
* eventParams['my-prop'] = 29;
|
||||||
|
* this.analyticsFirebase.logEvent('my-event', eventParams)
|
||||||
|
* .then(() => console.log('Event successfully tracked'))
|
||||||
|
* .catch(err => console.log('Error tracking event:', err));
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* // Reset analytics data
|
||||||
|
* this.analyticsFirebase.resetAnalyticsData()
|
||||||
|
* .then(() => console.log('Analytics data have been reset'))
|
||||||
|
* .catch(err => console.log('Error resetting analytics data:', err));
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* // Track a screen view
|
||||||
|
* this.analyticsFirebase.setCurrentScreen('Home')
|
||||||
|
* .then(() => console.log('View successfully tracked'))
|
||||||
|
* .catch(err => console.log('Error tracking view:', err));
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* // Set user id
|
||||||
|
* this.analyticsFirebase.setUserId('USER-ID')
|
||||||
|
* .then(() => console.log('User id successfully set'))
|
||||||
|
* .catch(err => console.log('Error setting user id:', err));
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* // Set user property from default properties
|
||||||
|
* this.analyticsFirebase.setUserProperty('KEY', 'VALUE')
|
||||||
|
* .then(() => console.log('User property successfully set'))
|
||||||
|
* .catch(err => console.log('Error setting user property:', err));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'AnalyticsFirebase',
|
||||||
|
plugin: 'cordova-plugin-analytics',
|
||||||
|
pluginRef: 'analytics',
|
||||||
|
repo: 'https://github.com/appfeel/analytics-google',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class AnalyticsFirebase extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* This enum represents AnalyticsFirebase default events.
|
||||||
|
* Use one of these default events or a custom event
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
@CordovaProperty()
|
||||||
|
readonly DEFAULT_EVENTS: {
|
||||||
|
ADD_PAYMENT_INFO: string;
|
||||||
|
ADD_TO_CART: string;
|
||||||
|
ADD_TO_WISHLIST: string;
|
||||||
|
APP_OPEN: string;
|
||||||
|
BEGIN_CHECKOUT: string;
|
||||||
|
CAMPAIGN_DETAILS: string;
|
||||||
|
CHECKOUT_PROGRESS: string;
|
||||||
|
EARN_VIRTUAL_CURRENCY: string;
|
||||||
|
ECOMMERCE_PURCHASE: string;
|
||||||
|
GENERATE_LEAD: string;
|
||||||
|
JOIN_GROUP: string;
|
||||||
|
LEVEL_END: string;
|
||||||
|
LEVEL_START: string;
|
||||||
|
LEVEL_UP: string;
|
||||||
|
LOGIN: string;
|
||||||
|
POST_SCORE: string;
|
||||||
|
PRESENT_OFFER: string;
|
||||||
|
PURCHASE_REFUND: string;
|
||||||
|
REMOVE_FROM_CART: string;
|
||||||
|
SEARCH: string;
|
||||||
|
SELECT_CONTENT: string;
|
||||||
|
SET_CHECKOUT_OPTION: string;
|
||||||
|
SHARE: string;
|
||||||
|
SIGN_UP: string;
|
||||||
|
SPEND_VIRTUAL_CURRENCY: string;
|
||||||
|
TUTORIAL_BEGIN: string;
|
||||||
|
TUTORIAL_COMPLETE: string;
|
||||||
|
UNLOCK_ACHIEVEMENT: string;
|
||||||
|
VIEW_ITEM: string;
|
||||||
|
VIEW_ITEM_LIST: string;
|
||||||
|
VIEW_SEARCH_RESULTS: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This enum represents AnalyticsFirebase default params.
|
||||||
|
* Use one of these default params or a custom param
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
@CordovaProperty()
|
||||||
|
readonly DEFAULT_PARAMS: {
|
||||||
|
ACHIEVEMENT_ID: string;
|
||||||
|
ACLID: string;
|
||||||
|
AFFILIATION: string;
|
||||||
|
CAMPAIGN: string;
|
||||||
|
CHARACTER: string;
|
||||||
|
CHECKOUT_OPTION: string;
|
||||||
|
CHECKOUT_STEP: string;
|
||||||
|
CONTENT: string;
|
||||||
|
CONTENT_TYPE: string;
|
||||||
|
COUPON: string;
|
||||||
|
CP1: string;
|
||||||
|
CREATIVE_NAME: string;
|
||||||
|
CREATIVE_SLOT: string;
|
||||||
|
CURRENCY: string;
|
||||||
|
DESTINATION: string;
|
||||||
|
END_DATE: string;
|
||||||
|
FLIGHT_NUMBER: string;
|
||||||
|
GROUP_ID: string;
|
||||||
|
INDEX: string;
|
||||||
|
ITEM_BRAND: string;
|
||||||
|
ITEM_CATEGORY: string;
|
||||||
|
ITEM_ID: string;
|
||||||
|
ITEM_LIST: string;
|
||||||
|
ITEM_LOCATION_ID: string;
|
||||||
|
ITEM_NAME: string;
|
||||||
|
ITEM_VARIANT: string;
|
||||||
|
LEVEL: string;
|
||||||
|
LEVEL_NAME: string;
|
||||||
|
LOCATION: string;
|
||||||
|
MEDIUM: string;
|
||||||
|
METHOD: string;
|
||||||
|
NUMBER_OF_NIGHTS: string;
|
||||||
|
NUMBER_OF_PASSENGERS: string;
|
||||||
|
NUMBER_OF_ROOMS: string;
|
||||||
|
ORIGIN: string;
|
||||||
|
PRICE: string;
|
||||||
|
QUANTITY: string;
|
||||||
|
SCORE: string;
|
||||||
|
SEARCH_TERM: string;
|
||||||
|
SHIPPING: string;
|
||||||
|
SOURCE: string;
|
||||||
|
START_DATE: string;
|
||||||
|
SUCCESS: string;
|
||||||
|
TAX: string;
|
||||||
|
TERM: string;
|
||||||
|
TRANSACTION_ID: string;
|
||||||
|
TRAVEL_CLASS: string;
|
||||||
|
VALUE: string;
|
||||||
|
VIRTUAL_CURRENCY_NAME: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs an app event. The event can have up to 25 parameters.
|
||||||
|
* Events with the same name must have the same parameters.
|
||||||
|
* Up to 500 event names are supported.
|
||||||
|
* Using predefined [FirebaseAnalytics.Event](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html) and/or [FirebaseAnalytics.Param](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Param.html) is recommended for optimal reporting.
|
||||||
|
*
|
||||||
|
* @param eventName {string} The event name
|
||||||
|
* @param eventParams {object} (Optional) The event params
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the event is logged
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
logEvent(eventName: string, eventParams?: object): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears all analytics data for this app from the device and resets the app instance id
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the analytics data is cleared
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
resetAnalyticsData(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether analytics collection is enabled for this app on this device. This setting is persisted across app sessions. By default it is enabled
|
||||||
|
* @param screenName {boolean} The value of the collection
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the collection is enabled/disabled
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current screen name, which specifies the current visual context in your app.
|
||||||
|
* This helps identify the areas in your app where users spend their time and how they interact with your app
|
||||||
|
* @param screenName {string} The screen name
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the current screen is setted
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setCurrentScreen(screenName: string): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the minimum engagement time required before starting a session. The default value is 10000 (10 seconds)
|
||||||
|
* @param screenName {number} The duration in milliseconds
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the minimum session duration is set
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setMinimumSessionDuration(milliseconds: number): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the duration of inactivity that terminates the current session. The default value is 1800000 (30 minutes)
|
||||||
|
* @param screenName {number} The duration in milliseconds
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the session timeout duration is set
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setSessionTimeoutDuration(milliseconds: number): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the user ID property. This feature must be used in accordance with Google's Privacy Policy
|
||||||
|
* @param userId {string} The user id
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the user id is setted
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserId(userId: string): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a user property to a given value. Up to 25 user property names are supported. Once set, user property values persist throughout the app lifecycle and across sessions
|
||||||
|
* @param userPropertyName {string} The user property name
|
||||||
|
* @param userPropertyValue {string} The user property value
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when the user property setted
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserProperty(userPropertyName: string, userPropertyValue: string): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user