diff --git a/js/core/telemetryV3Interface.js b/js/core/telemetryV3Interface.js index d1032cb..362c4f7 100644 --- a/js/core/telemetryV3Interface.js +++ b/js/core/telemetryV3Interface.js @@ -553,16 +553,17 @@ var Telemetry = (function() { EXCLUDED: 'excluded' } this.telemetry.getFingerPrint = function (cb) { - if (localStorage && localStorage.getItem('fpDetails')) { - var deviceDetails = JSON.parse(localStorage.getItem('fpDetails')); - if (cb) cb(deviceDetails.result, deviceDetails.components); + const ver = 'v1'; + if (localStorage && localStorage.getItem(`fpDetails_${ver}`)) { + var deviceDetails = JSON.parse(localStorage.getItem(`fpDetails_${ver}`)); + if (cb) cb(deviceDetails.result, deviceDetails.components, ver); } else { Fingerprint2.getV18(FPoptions, function (result, components) { if (localStorage) { // fpDetails contains components and deviceId generated from fingerprintJs - localStorage.setItem('fpDetails', JSON.stringify({result: result, components: components})) + localStorage.setItem(`fpDetails_${ver}`, JSON.stringify({result: result, components: components})) } - if (cb) cb(result, components) + if (cb) cb(result, components, ver) }) } } diff --git a/js/dist/index.js b/js/dist/index.js index 77bace8..0e1979f 100644 --- a/js/dist/index.js +++ b/js/dist/index.js @@ -2355,16 +2355,17 @@ var Telemetry = (function() { EXCLUDED: 'excluded' } this.telemetry.getFingerPrint = function (cb) { - if (localStorage && localStorage.getItem('fpDetails')) { - var deviceDetails = JSON.parse(localStorage.getItem('fpDetails')); - if (cb) cb(deviceDetails.result, deviceDetails.components); + const ver = 'v1'; + if (localStorage && localStorage.getItem(`fpDetails_${ver}`)) { + var deviceDetails = JSON.parse(localStorage.getItem(`fpDetails_${ver}`)); + if (cb) cb(deviceDetails.result, deviceDetails.components, ver); } else { Fingerprint2.getV18(FPoptions, function (result, components) { if (localStorage) { // fpDetails contains components and deviceId generated from fingerprintJs - localStorage.setItem('fpDetails', JSON.stringify({result: result, components: components})) + localStorage.setItem(`fpDetails_${ver}`, JSON.stringify({result: result, components: components})) } - if (cb) cb(result, components) + if (cb) cb(result, components, ver) }) } } diff --git a/js/dist/package.json b/js/dist/package.json index 5b906d1..66d65f4 100644 --- a/js/dist/package.json +++ b/js/dist/package.json @@ -1,6 +1,6 @@ { "name": "@project-sunbird/telemetry-sdk", - "version": "0.0.19", + "version": "0.0.20", "description": "Telemetry Service javascript library helps to generate the telemetry events.", "directories": { "example": "example", diff --git a/js/package.json b/js/package.json index 5b906d1..66d65f4 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "@project-sunbird/telemetry-sdk", - "version": "0.0.19", + "version": "0.0.20", "description": "Telemetry Service javascript library helps to generate the telemetry events.", "directories": { "example": "example",