Yesterday I got a question about embedded images with my node-red-contrib-ui-web-push node. In this link you can see that it is possible to embed an image into a web push notification. For example when your camera capture an image of a burglar, you can send that image to your Android smartphone inside the notification:
However you need to include an image URI in the notification, which has some disadvantages:
- You probably don't want the image to be public accessible to everybody on the internet.
- The image should only be temporary available on the internet (until the client has read it). But you don't know how long ...
Luckily the web push notification documentation shows that the image url can be a data URI:
A data URI means that the resource (in this case the camera snapshot image) will be base64 encoded and included inside the URL. As a result the resource can be kept private, and can be removed after we have pushed it to our clients (e.g. Android smartphone).
To simplify this a bit, I developed the node-red-contrib-data-uri node
As always all "constructive" feedback is very welcome !!
P.S. It is not available on NPM yet, so if you want to test it you can install it directly from my Github repository (from within your .node-red folder):
npm install bartbutenaers/node-red-contrib-data-uri
Have fun with it!!