Dynamic PWA image and app title

Hi All,

Currently building a SASS product through weweb that we plan to white label. Using Coalias to do so. We currently have it setup in such a way that the white label is all using the same instance of weweb, with each white label version being able to edit their colours, logo and title. This part is working great!

My question is most of our users will be on mobile, and we are using the PWA capabilities of weweb, it is possible to have a dynamic app name and app icon? Am I able to link it to a variable in someway, or would I be able to use JS to do so somehow?

If not is there another way we can enable PWA using a third party?

You can do this, but probably judt with self hosting.

trying to avoid self hosting if we can

In this case you can’t, otherwise I wouldn’t have mentioned it :slight_smile:

I believe you actually can do this, as you can define your own manifest file now. :thinking: I’ve never done it, but since you can now define manifest.json, you should be able to define it, and link other JS to modify it.

You could probably just follow a standard web tutorial and it’d get you most of the way.

@Broberto Am I missing anything specific that would be a blocker?

1 Like

I’m not sure about the custom (own) manifest. If you provide a reference to that, then I might have a look. By deafult afaik, it is not possible to bind dynamic values, without code export, and it hasn’t been announced officially that you can do your own manifests, right?

Edit, found your comment here

Then yeah, if WeWeb recognizes this and honors this, and of course if you manage somehow to write to the WeWeb’s file system, then you can have a dynamic behavior. But I’m not sure if it’s possible to go and overwrite this dynamically, because you’d be overwriting the one file all over and over again, which might cause conflicts - could cause a racing condition, where two tenants overwrite the manifest in simple terms. This can be handled with Code Export, but within WeWeb, I think it would be difficult.

You could try this javascript - How to create dynamic manifest.json file for PWA in ReactJS? - Stack Overflow, but it would require sticking that JS into your app and hoping that the way it’s set up is gonna work. Of course if you don’t make it work, by modifying the exported code. Edit 2: This won’t work, I just tried it out

What you could do, is store somewhere the static files to your manifests, or generate them on demand, and then with some JS change the source of the manifest. But the answers suggest that you’d probably need to serve it a static file.

I think you’d be better off by exporting the code and doing this dynamically there. Seems like any of the “quick” methods to set the manifest dynamically don’t work.

1 Like