Skip to content

Commit

Permalink
Merge pull request #20 from yravinderkumar33/release-2.2.0-fingerprintv2
Browse files Browse the repository at this point in the history
Issue #SB-13787 fix  :20% of device IDs still showing up as duplicates
  • Loading branch information
rajeevsathish authored Aug 8, 2019
2 parents 2d3c46b + 10eca53 commit 6706b9d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions js/core/telemetryV3Interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}
Expand Down
11 changes: 6 additions & 5 deletions js/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/dist/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6706b9d

Please sign in to comment.