@fttx/cordova-plugin-firebase-analytics
Advanced tools
Comparing version 8.0.0 to 8.2.0
{ | ||
"name": "@fttx/cordova-plugin-firebase-analytics", | ||
"version": "8.0.0", | ||
"version": "8.2.0", | ||
"description": "Cordova plugin for Firebase Analytics", | ||
@@ -33,6 +33,6 @@ "types": "./types/index.d.ts", | ||
"scripts": { | ||
"preversion": "npm run docs && rm -rf docs", | ||
"preversion": "", | ||
"version": "perl -i -pe 's/(version=)\"\\d+\\.\\d+\\.\\d+\"/$1\"'$npm_package_version'\"$2/' plugin.xml && git add .", | ||
"postversion": "git push && git push --tags", | ||
"predocs": "tsc www/* --declaration --allowJs --checkJs --lib es2015,dom --emitDeclarationOnly --outDir types", | ||
"predocs": "npx tsc www/* --declaration --allowJs --checkJs --lib es2015,dom --emitDeclarationOnly --outDir types", | ||
"docs": "typedoc && perl -i -pe 's/README.md#/#/g' ./docs/README.md", | ||
@@ -42,5 +42,7 @@ "postdocs": "perl -i -0pe 's/(<!-- TypedocGenerated -->).*/$1\n\n/gms' README.md && cat ./docs/README.md >> README.md" | ||
"devDependencies": { | ||
"npx": "^10.2.2", | ||
"typedoc": "^0.23.9", | ||
"typedoc-plugin-markdown": "^3.13.4" | ||
"typedoc-plugin-markdown": "^3.13.4", | ||
"typescript": "4.7" | ||
} | ||
} |
@@ -31,2 +31,3 @@ # Cordova plugin for [Firebase Analytics](https://firebase.google.com/docs/analytics/) | ||
- [setEnabled](#setenabled) | ||
- [setAnalyticsConsent](#setAnalyticsConsent) | ||
- [setUserId](#setuserid) | ||
@@ -47,7 +48,7 @@ - [setUserProperty](#setuserproperty) | ||
If you get an error about CocoaPods being unable to find compatible versions, run | ||
$ pod repo update | ||
Use variables `ANDROID_FIREBASE_BOM_VERSION` or `IOS_FIREBASE_POD_VERSION` to override dependency versions for Firebase SDKs: | ||
$ cordova plugin add cordova-plugin-firebase-analytics \ | ||
@@ -209,2 +210,21 @@ --variable IOS_FIREBASE_POD_VERSION="9.3.0" \ | ||
___ | ||
### setAnalyticsConsent | ||
**setAnalyticsConsent**(`json object`): `Promise`<`void`\> | ||
Sets the consent map | ||
**`Example`** | ||
```ts | ||
cordova.plugins.firebase.analytics.setAnalyticsConsent({ | ||
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE": true, | ||
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE": true, | ||
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA": true, | ||
"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS": true | ||
}); | ||
``` | ||
#### Parameters | ||
@@ -211,0 +231,0 @@ |
@@ -57,2 +57,29 @@ /** | ||
/** | ||
* Sets the consent settings for Firebase Analytics based on provided boolean parameters. | ||
* | ||
* @param {Object} consentSettings An object containing boolean values for various consent settings: | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE": {boolean} - Grants or denies consent for analytics storage. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE": {boolean} - Grants or denies consent for ad storage. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA": {boolean} - Grants or denies consent for ad user data. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS": {boolean} - Grants or denies consent for ad personalization signals. | ||
* @returns {Promise<void>} Callback when the operation is completed | ||
* | ||
* @example | ||
* cordova.plugins.firebase.analytics.setAnalyticsConsent({ | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS": true | ||
* }); | ||
*/ | ||
export function setAnalyticsConsent(consentSettings: { | ||
ANALYTICS_COLLECTION_ENABLED: boolean, | ||
AUTOMATIC_SCREEN_REPORTING_ENABLED: boolean, | ||
GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE: boolean, | ||
GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE: boolean, | ||
GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA: boolean, | ||
GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS: boolean | ||
}): Promise<void>; | ||
/** | ||
* 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. | ||
@@ -59,0 +86,0 @@ * |
@@ -90,2 +90,28 @@ var PLUGIN_NAME = "FirebaseAnalytics"; | ||
exports.setAnalyticsConsent = | ||
/** | ||
* Sets the consent settings for Firebase Analytics based on provided boolean parameters. | ||
* | ||
* @param {Object} consentSettings An object containing boolean values for various consent settings: | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE": {boolean} - Grants or denies consent for analytics storage. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE": {boolean} - Grants or denies consent for ad storage. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA": {boolean} - Grants or denies consent for ad user data. | ||
* - "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS": {boolean} - Grants or denies consent for ad personalization signals. | ||
* @returns {Promise<void>} Callback when the operation is completed | ||
* | ||
* @example | ||
* cordova.plugins.firebase.analytics.setAnalyticsConsent({ | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA": true, | ||
* "GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS": true | ||
* }); | ||
*/ | ||
function(consentSettings) { | ||
return new Promise(function(resolve, reject) { | ||
exec(resolve, reject, PLUGIN_NAME, "setAnalyticsConsent", [consentSettings]); | ||
}); | ||
}; | ||
exports.setCurrentScreen = | ||
@@ -92,0 +118,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36933
257
299
4