Assume, in a multi-tenant platform, where domain name is same but a tenant is identified by a tenant id (won't have a folder in same name nor tenant's html under it, so 'scope' I doubt it will work, because every page here works for every tenant), like in this simple e.g., 'www.mysite.com?id=abccompany' for a tenant 'abc company' & while 'www.mysite.com?id=xyzcompany' for a tenant 'xyz company', 1) can I give different add-to-home text+logo when each of the urls are opened? that directs to 2) Whether I can have different manifest & serviceworker? or 3) achieve it though same service worker but different manifest, notification channel & add home text+logo? Or limited by one domain one add-to-home? Thanking you in advance.
Asked
Active
Viewed 592 times
0
-
1Hi... Were you able to achieve this functionality? – ravee Oct 21 '20 at 05:24
1 Answers
0
If you check out Google's brief on The Web App Manifest you can see they are referenced with a simple <link rel="manifest" href="/manifest.json">
link. If your app/server can read the query parameter "id" and update that link accordingly with a unique manifest file based on the id, you may achieve what you are looking for.
You may also want to read Possible to have multiple manifest.json
for PWA?

A. Niese
- 399
- 3
- 13
-
1. I am able to get set different manifest file for each tenant, & on page load I am getting respective manifest for the tenant in context. 2. start_url i set with respective tenant id, for each tenant, say 'www.mysite.com?id=xyzcompany' so that also fine. But, **Service Worker getting registered is once for all tenants** (in the above case, once for abc & xyz), though Service Workers to install Add-to-Home & receive notifications remains different for each tenant. Once a tenant's Add-to-Home is done, it is not prompting for Add-to-Home for any other tenant's home page opened in same browser. – Hursh Sep 09 '19 at 10:23
-
@Hursh You may need to check the domain name while installing the service worker. – besrabasant May 14 '20 at 14:45