Using Analysis to push notifications to Run User?

Hi, what is the common way to send a push notification to Run Users with specific tags from an Analysis? So far I’m only able to push to myself as the account profile:

const notification = new Services({ token: context.token }).Notification;
notification.send({
title: Freezing NOTIFICATION,
message: ${device.name}: The temperature is just above 0 ˚C
});

Thanks!
Vincent

Please ignore… found the solution in the manual. Who reads the manual right?

if (userID_tag) {
await account.run.notificationCreate(userID_tag.value, {
title: ‘Notification Alert’,
message: You received a notification for the device: ${device_name}. Variable: ${scope[0].variable}, Value: ${scope[0].value},
}).then(context.log).catch(context.log);
} else {
context.log(‘User ID not found for this device.’);
}

1 Like