I'm trying to get notifications working for an Electron app I've made using Angular 5 and Electron. So far I have the following code in my index.html file:
<script type="text/javascript">
function doNotify() {
new Notification( "Basic Notification", "Short message part");
}
window.onload = doNotify;
</script>
In my package.json I have the appId setup as below:
"build": {
"appId":"com.myapp.id"
},
and finally I have this in my main.js:
app.setAppUserModelId("com.myapp.id");
As I've read in places that both of these are required to make notifications work. I am using electron forge to build a squirrel installer as this is also mentioned to be required to get notifications to work.
I have tried using similar notification code in my angular components but have no luck there either. I have looked into node-notifier but am unable to get that to work, mainly due to a lack of understanding of where it should go in an Angular-Electron app.
At this point all I want is to get some form of desktop notification working, but I can't find any resources on how to do that in an Angular-Electron app.