Eneris / push-receiver

A library to subscribe to GCM/FCM and receive notifications within a node process.
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
16 stars 15 forks source link

Support for emulating iOS #14

Closed cserby closed 6 months ago

cserby commented 6 months ago

I'm looking into using the library for testing push notifications sent to Android and iOS mobile phones from a Backend service. As far as I can tell from https://github.com/Eneris/push-receiver/blob/master/src/client.ts#L291, the library is simulating an Android device. Some fields are filtered from the notifications the backend sends, when being received by Android phones (ex. .apns), thus I cannot check if they're set properly.

Would it be feasible to implement iOS emulation as a selectable option?

Eneris commented 6 months ago

Hi I don't think it's possible right now. The emulating of Android device is taken from the Chromium source code which is emulating the Android device in the first place. So I don't have insights into how it's communicating in real mobile devices.

Feel free to add the info if you find it. Thanks :)

cserby commented 6 months ago

I've done some digging into the subject, FCM seems to rely on APNS to deliver pushes to iOS devices, and the receiver interface of APNS doesn't seem to be open. So there it goes, I need fall back to manual testing with real devices...