I'm trying to implement pushwoosh on Electron ( https://electronjs.org/ ).
Electron uses Chromium (google chrome core) to create native apps.
Although, the chrome API is not working, since electron is missing some implementations of push notification.
In other words, I cant use service workers becasue Electron loads urls from file://, and even if I used https, serviceWorkerRegistration.pushManager.subscribe() is not implemented. Remember that electron uses chromium, not chrome.
Of course, if I open my app in google chrome, pushwoosh works.
So I decided to implement the pushwoosh manually, sending https requests to /registerDevice endpoint. (https://docs.pushwoosh.com/reference)
Also I used this plugin https://github.com/MatthieuLemoine/electron-push-receiver that receives the notifications directly from google firebase.
And it worked! Everything worked wonderfully. I can use pushwoosh now on electron.
But althought it worked with a simple register device endpoint, I know pushwoosh does much more than that.
For example the hwid. I could not find where or how to generate it properly. I'm generating my own hwid with a random string and it seems to be working. But I wanted to be able to generate the same hardware Id that the chrome api uses.
Remember I can't load the chrome pushwoosh api, it crashes on electron for lack of methods implementation and no service worker.
So my questions are:
1 - Is there a way to generate hardware id ? I saw the chrome pushwoosh JS minified code and it generates from the push token and pushwoosh application id. But reading the minified code is very hard and gave me headaches. Is there a non-minified method stub I can call to generate this value? Is it ok If I simply generate my own? (it seems to be working for now).
2 - is there a guide on when and which methods to call manually on the endpoints (https://docs.pushwoosh.com/reference) to implement pushwoosh manually?
3 - will I be missing any pushwoosh features if I don't implement all the optional information on every pushwoosh endpoint? (I think the methods are register device and application open
Please sign in to leave a comment.