Hi,
I have posted this question on stack over flow last week but have not got any response so trying to reach out here.
TLDR;
After user is redirected to
www.domain.com/otherapp it is marked deleted but I am not able to receive any push events.
If I dont address the scope, the s/w is marked redundant right away once user leaves myapp.
So I set the scope and same in the service worker header response.
I dont have root app control (for now) so I am registering my s/w at /myapp in following mannrers
- navigator.serviceWorker.register('/myapp/js/serviceWorker.js')
- navigator.serviceWorker.register('/myapp/js/serviceWorker.js', {scope: '/'})
- navigator.serviceWorker.register('/myapp/js/serviceWorker.js', {scope: '/otherapp'})
I have also made sure the respective scope in the s/w header in the response.
In all the above scenarios the s/w is marked deleted or redundant in case of no scope.
I am not sure if scope is the way to solve this or anything else I am missing.
One thing I have to try as per colleague's recommendation is registering at root level but I dont know if that is possible -
navigator.serviceWorker.register('/serviceWorker.js');
Please let me know if someone has any lead.
Thank you.
- Mitesh Jain.