Skip to content

Commit 8e87fb7

Browse files
committed
Added telemetry
1 parent af28953 commit 8e87fb7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

app.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,24 @@ module.exports = class AndroidworldApp extends Homey.App {
5656
this.error('Error fetching Androidworld feed:', error);
5757
}
5858
} , 15 * 60 * 1000);
59-
59+
try {
60+
const { randomUUID } = require('crypto');
61+
let id = this.homey.settings.get('id');
62+
if (!id) {
63+
id = randomUUID();
64+
this.homey.settings.set('id', id);
65+
}
66+
await axios.post('https://homey-apps-telemetry.vercel.app/api/installations', {
67+
id: id,
68+
appId: "nl.androidworld",
69+
homeyPlatform: this.homey.platformVersion ? this.homey.platformVersion : 1,
70+
appVersion: this.manifest.version,
71+
}).catch(error => {
72+
this.error('Error sending telemetry data:', error.message);
73+
});
74+
} catch (error) {
75+
this.error('Error in onInit:', error.message);
76+
}
6077
}
6178

6279
};

0 commit comments

Comments
 (0)