{"_id":"59f79e3c584eb200345ceccb","project":"59f79e3c584eb200345ceafc","user":{"_id":"54e4044e8ef7552300409dcb","username":"","name":"Sankaet Pathak"},"initVersion":{"_id":"59f79e3c584eb200345ceafe","version":"3.0"},"__v":0,"createdAt":"2015-07-17T23:03:23.017Z","changelog":[],"body":"Recently developers have asked us for suggestions about collecting fingerprints across devices (web, iOS & android). Here are some ideas:\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Web Browsers\"\n}\n[/block]\nTo collect fingerprints on the web, our suggestion is to use Valve's [Fingerprint.js2](https://github.com/Valve/fingerprintjs2).\n\nJust import the JS file and do the following \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"new Fingerprint2().get(function(result){\\n  // this will use all available fingerprinting sources\\n  console.log('This is the fingerprint '+result);\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"iOS\"\n}\n[/block]\nFor iOS we suggest using UIDevice currentDevice method. Its pretty straightforward. Here is an example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#pragma mark - get device ID\\n- (NSString *)deviceID{\\n    return [NSString stringWithFormat:@\\\"%@-AAPL\\\",[UIDevice currentDevice].identifierForVendor.UUIDString];\\n}\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Android\"\n}\n[/block]\nFor android we suggest using a logic like the following\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public static String getDeviceID(Context activity) {\\n        String androidID = Settings.Secure.getString(activity.getContentResolver(),Settings.Secure.ANDROID_ID);\\n        StringBuilder stringBuilder = new StringBuilder();\\n        stringBuilder.append(Build.MANUFACTURER.toUpperCase()+\\\"-\\\");\\n        stringBuilder.append(Build.MODEL+\\\"-\\\");\\n        stringBuilder.append(androidID);\\n        stringBuilder.append(\\\"-GOOG\\\");\\n        androidID = stringBuilder.toString();\\n        return androidID;\\n    }\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]","slug":"collecting-fingerprints-on-different-devices","title":"Collecting Fingerprints on different devices"}

Collecting Fingerprints on different devices


Recently developers have asked us for suggestions about collecting fingerprints across devices (web, iOS & android). Here are some ideas: [block:api-header] { "type": "basic", "title": "Web Browsers" } [/block] To collect fingerprints on the web, our suggestion is to use Valve's [Fingerprint.js2](https://github.com/Valve/fingerprintjs2). Just import the JS file and do the following [block:code] { "codes": [ { "code": "new Fingerprint2().get(function(result){\n // this will use all available fingerprinting sources\n console.log('This is the fingerprint '+result);\n});", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "iOS" } [/block] For iOS we suggest using UIDevice currentDevice method. Its pretty straightforward. Here is an example [block:code] { "codes": [ { "code": "#pragma mark - get device ID\n- (NSString *)deviceID{\n return [NSString stringWithFormat:@\"%@-AAPL\",[UIDevice currentDevice].identifierForVendor.UUIDString];\n}", "language": "objectivec" } ] } [/block] [block:api-header] { "type": "basic", "title": "Android" } [/block] For android we suggest using a logic like the following [block:code] { "codes": [ { "code": "public static String getDeviceID(Context activity) {\n String androidID = Settings.Secure.getString(activity.getContentResolver(),Settings.Secure.ANDROID_ID);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(Build.MANUFACTURER.toUpperCase()+\"-\");\n stringBuilder.append(Build.MODEL+\"-\");\n stringBuilder.append(androidID);\n stringBuilder.append(\"-GOOG\");\n androidID = stringBuilder.toString();\n return androidID;\n }", "language": "java" } ] } [/block]