countly-sdk-react-native-bridge
Advanced tools
Comparing version 20.4.6 to 20.4.7
@@ -0,1 +1,4 @@ | ||
## 20.4.7 | ||
* Adding call to set consent during init | ||
## 20.4.6 | ||
@@ -2,0 +5,0 @@ * Adding APM calls |
@@ -246,3 +246,5 @@ /** | ||
if(!await Countly.isInitialized()) { | ||
console.warn('getCurrentDeviceId, init must be called before getCurrentDeviceId'); | ||
if(await CountlyReactNative.isLoggingEnabled()) { | ||
console.warn('[CountlyReactNative] getCurrentDeviceId, init must be called before getCurrentDeviceId'); | ||
} | ||
return "init must be called before getCurrentDeviceId"; | ||
@@ -280,5 +282,7 @@ } | ||
*/ | ||
Countly.enableCrashReporting = function(){ | ||
Countly.enableCrashReporting = async function(){ | ||
if (ErrorUtils && !Countly.isCrashReportingEnabled) { | ||
console.log("Adding Countly JS error handler."); | ||
if(await CountlyReactNative.isLoggingEnabled()) { | ||
console.log("[CountlyReactNative] Adding Countly JS error handler."); | ||
} | ||
var previousHandler = ErrorUtils.getGlobalHandler(); | ||
@@ -491,2 +495,23 @@ ErrorUtils.setGlobalHandler(function (error, isFatal) { | ||
/** | ||
* | ||
* Give consent for specific features before init. | ||
* Should be call after Countly init | ||
*/ | ||
Countly.giveConsentInit = async function(args){ | ||
var features = []; | ||
if (typeof args == "string") { | ||
features.push(args); | ||
} | ||
else if(Array.isArray(args)) { | ||
features = args; | ||
} | ||
else { | ||
if(await CountlyReactNative.isLoggingEnabled()) { | ||
console.warn("[CountlyReactNative] giveConsentInit, unsupported data type '" + (typeof args) + "'"); | ||
} | ||
} | ||
CountlyReactNative.giveConsentInit(features); | ||
} | ||
Countly.removeConsent = function(args){ | ||
@@ -493,0 +518,0 @@ var features = []; |
@@ -48,2 +48,3 @@ import React, { Component } from 'react'; | ||
Countly.setRequiresConsent(true); // Set that consent should be required for features to work. | ||
Countly.giveConsentInit(["location", "sessions", "attribution", "push", "events", "views", "crashes", "users", "push", "star-rating", "apm"]); // give conset for specific features before init. | ||
Countly.setLocationInit("TR", "Istanbul", "41.0082,28.9784", "10.2.33.12"); // Set user initial location. | ||
@@ -70,5 +71,2 @@ | ||
Countly.askForNotificationPermission(); // This method will ask for permission, enables push notification and send push token to countly server. | ||
Countly.giveAllConsent(); // give consent for all features, should be call after init | ||
// Countly.giveConsent(["events", "views"]); // give conset for some specific features, should be call after init. | ||
} | ||
@@ -75,0 +73,0 @@ } |
{ | ||
"name": "countly-sdk-react-native-bridge", | ||
"version": "20.4.6", | ||
"version": "20.4.7", | ||
"author": "Countly <hello@count.ly> (https://count.ly/)", | ||
@@ -5,0 +5,0 @@ "bugs": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
351967
37
2113
0