🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

cordova-plugin-firebase-analytics

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-firebase-analytics - npm Package Compare versions

Comparing version

to
7.0.4

{
"name": "cordova-plugin-firebase-analytics",
"version": "7.0.3",
"version": "7.0.4",
"description": "Cordova plugin for Firebase Analytics",

@@ -40,7 +40,2 @@ "types": "./types/index.d.ts",

},
"lint-staged": {
"www/**/*.js": [
"npm run docs"
]
},
"devDependencies": {

@@ -47,0 +42,0 @@ "typedoc": "^0.23.9",

@@ -113,3 +113,3 @@ # Cordova plugin for [Firebase Analytics](https://firebase.google.com/docs/analytics/)

| `name` | `string` | Enent name |
| `params` | `Record`<`string`, `any`\> | Event parameters |
| `params` | `Record`<`string`, `string` \| `number` \| `object`[]\> | Event parameters |

@@ -186,3 +186,3 @@ #### Returns

| :------ | :------ | :------ |
| `defaults` | `Record`<`string`, `any`\> | Key-value default parameters map |
| `defaults` | `Record`<`string`, `string` \| `number` \| `object`[]\> | Key-value default parameters map |

@@ -189,0 +189,0 @@ #### Returns

/**
*
* Logs an app event.
*
* @param {string} name Enent name
* @param {Record<string, object>} params Event parameters
* @param {Record<string, number | string | Array<object>>} params Event parameters
* @returns {Promise<void>} Callback when operation is completed

@@ -12,5 +11,4 @@ *

*/
export function logEvent(name: string, params: Record<string, any>): Promise<void>;
export function logEvent(name: string, params: Record<string, number | string | Array<object>>): Promise<void>;
/**
*
* Sets the user ID property. This feature must be used in accordance with Google's Privacy Policy.

@@ -28,3 +26,2 @@ *

/**
*
* Sets a user property to a given value. Be aware of automatically collected user properties.

@@ -43,3 +40,2 @@ *

/**
*
* Clears all analytics data for this instance from the device and resets the app instance ID.

@@ -54,3 +50,2 @@ *

/**
*
* Sets whether analytics collection is enabled for this app on this device.

@@ -66,3 +61,2 @@ *

/**
*
* 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.

@@ -78,5 +72,4 @@ *

/**
*
* Adds parameters that will be set on every event logged from the SDK, including automatic ones.
* @param {Record<string, object>} defaults Key-value default parameters map
* @param {Record<string, number | string | Array<object>>} defaults Key-value default parameters map
* @returns {Promise<void>} Callback when operation is completed

@@ -87,2 +80,2 @@ *

*/
export function setDefaultEventParameters(defaults: Record<string, any>): Promise<void>;
export function setDefaultEventParameters(defaults: Record<string, number | string | Array<object>>): Promise<void>;

@@ -5,131 +5,116 @@ var PLUGIN_NAME = "FirebaseAnalytics";

module.exports = {
logEvent:
/**
*
* Logs an app event.
*
* @param {string} name Enent name
* @param {Record<string, object>} params Event parameters
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.logEvent("my_event", {param1: "value1"});
*/
function(name, params) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "logEvent", [name, params || {}]);
});
},
setUserId:
/**
*
* Sets the user ID property. This feature must be used in accordance with Google's Privacy Policy.
*
* @param {string} userId User's indentifier string
* @returns {Promise<void>} Callback when operation is completed
*
* @see https://www.google.com/policies/privacy
*
* @example
* cordova.plugins.firebase.analytics.setUserId("12345");
*/
function(userId) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setUserId", [userId]);
});
},
setUserProperty:
/**
*
* Sets a user property to a given value. Be aware of automatically collected user properties.
*
* @param {string} name Property name
* @param {string} value Property value
* @returns {Promise<void>} Callback when operation is completed
*
* @see https://support.google.com/firebase/answer/6317486?hl=en&ref_topic=6317484
*
* @example
* cordova.plugins.firebase.analytics.setUserProperty("name1", "value1");
*/
function(name, value) {
return new Promise(function(resolve, reject) {
if (typeof name !== "string") {
return reject(new TypeError("User property name must be a string"));
}
exports.logEvent =
/**
* Logs an app event.
*
* @param {string} name Enent name
* @param {Record<string, number | string | Array<object>>} params Event parameters
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.logEvent("my_event", {param1: "value1"});
*/
function(name, params) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "logEvent", [name, params || {}]);
});
};
if (typeof value !== "string") {
return reject(new TypeError("User property value must be a string"));
}
exports.setUserId =
/**
* Sets the user ID property. This feature must be used in accordance with Google's Privacy Policy.
*
* @param {string} userId User's indentifier string
* @returns {Promise<void>} Callback when operation is completed
*
* @see https://www.google.com/policies/privacy
*
* @example
* cordova.plugins.firebase.analytics.setUserId("12345");
*/
function(userId) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setUserId", [userId]);
});
};
exec(resolve, reject, PLUGIN_NAME, "setUserProperty", [name, value]);
});
},
resetAnalyticsData:
/**
*
* Clears all analytics data for this instance from the device and resets the app instance ID.
*
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.resetAnalyticsData();
*/
function() {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "resetAnalyticsData", []);
});
},
setEnabled:
/**
*
* Sets whether analytics collection is enabled for this app on this device.
*
* @param {boolean} enabled Flag that specifies new state
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setEnabled(false);
*/
function(enabled) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setEnabled", [enabled]);
});
},
setCurrentScreen:
/**
*
* 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 {string} screenName Current screen name
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setCurrentScreen("User dashboard");
*/
function(screenName) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setCurrentScreen", [screenName]);
});
},
setDefaultEventParameters:
/**
*
* Adds parameters that will be set on every event logged from the SDK, including automatic ones.
* @param {Record<string, object>} defaults Key-value default parameters map
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setDefaultEventParameters({foo: "bar"});
*/
function(defaults) {
return new Promise(function(resolve, reject) {
if (typeof defaults !== "object") {
return reject(new TypeError("Defaults must be an object"));
}
exports.setUserProperty =
/**
* Sets a user property to a given value. Be aware of automatically collected user properties.
*
* @param {string} name Property name
* @param {string} value Property value
* @returns {Promise<void>} Callback when operation is completed
*
* @see https://support.google.com/firebase/answer/6317486?hl=en&ref_topic=6317484
*
* @example
* cordova.plugins.firebase.analytics.setUserProperty("name1", "value1");
*/
function(name, value) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setUserProperty", [name, value]);
});
};
exec(resolve, reject, PLUGIN_NAME, "setDefaultEventParameters", [defaults || {}]);
});
}
exports.resetAnalyticsData =
/**
* Clears all analytics data for this instance from the device and resets the app instance ID.
*
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.resetAnalyticsData();
*/
function() {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "resetAnalyticsData", []);
});
};
exports.setEnabled =
/**
* Sets whether analytics collection is enabled for this app on this device.
*
* @param {boolean} enabled Flag that specifies new state
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setEnabled(false);
*/
function(enabled) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setEnabled", [enabled]);
});
};
exports.setCurrentScreen =
/**
* 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 {string} screenName Current screen name
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setCurrentScreen("User dashboard");
*/
function(screenName) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setCurrentScreen", [screenName]);
});
};
exports.setDefaultEventParameters =
/**
* Adds parameters that will be set on every event logged from the SDK, including automatic ones.
* @param {Record<string, number | string | Array<object>>} defaults Key-value default parameters map
* @returns {Promise<void>} Callback when operation is completed
*
* @example
* cordova.plugins.firebase.analytics.setDefaultEventParameters({foo: "bar"});
*/
function(defaults) {
return new Promise(function(resolve, reject) {
exec(resolve, reject, PLUGIN_NAME, "setDefaultEventParameters", [defaults || {}]);
});
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet