Web Push deviceRegistration fails on iOS simulator
Reproduction
- Open iOS Simulator with any iOS 18 version
- go to your web/localhost app
- Instal it as PWA
- Open PWA
- Try to register the device for push notifications
Expectation
The registration is successful
Reliability
The registration fails because targetUrl and encryptionKey are not correctly generated
{
"id": "01K****EDITED****",
"deviceSecret": "01K1WF4QF8SZME23EWQ2DT3QNH",
"platform": "browser",
"formFactor": "desktop",
"deviceIdentityToken": null,
"push": {
"recipient": {
"transportType": "web",
"targetUrl": "",
"publicVapidKey": "BM-****EDITED****",
"encryptionKey": {
"p256dh": "",
"auth": ""
}
}
}
}
The same works on browser and android emulators.
If needed I can provide a test URL in private.
Hey @distante,
Sorry for the delay. We looked into this, and unfortunately it appears to be an iOS emulator limitation. We couldn’t find any documentation on this behavior, as there’s almost no documentation on PWA support in the emulator.
If you know of any workaround to enable or test web push on the iOS emulator, please share it! we’ll take a look and, if feasible, consider implementing it.
I stopped testing in iOS and just trusted it works. 🙈
On a real device works.