Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

Same PWA different Homeviews #214

Closed L-David closed 5 years ago

L-David commented 6 years ago

Hi, I'm currently trying to create a PWA that with the starting URL can pre-set some information.

The objective: There are main users that want to share their microsite with other people, they should be able to pull down down the PWA with the correct preset data so when open it takes the information of the main user.

For example, in a school, if they share a link among a group of students, the group should be able to pull down the PWA with the appropriate data of the group they are. So they can see the information about the school, the teachers assigned, etc. (with just the link no auth step, because it's not restricted information)

Is there a way of sharing a link and preset the data, base on the URL example: institution?group=00A

(My solution so far is to construct a bunch of different sets of manifests for the same PWA and store them which doesn't work too well).

frankiefu commented 6 years ago

You should be able to just fetch the data that you need to display for the route. Maybe take a look at the pwa-starter-kit-hn app. There it extracts the id from the query param and uses the id to fetch the user profile to render the user view. In your case instead of user id it will be group id, and instead of user view it will be home view.

frankiefu commented 5 years ago

Closing this - please reopen if there are more questions about this.