Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple PWA apps on same server #16

Open
JustAPhrog opened this issue May 10, 2019 · 7 comments
Open

Multiple PWA apps on same server #16

JustAPhrog opened this issue May 10, 2019 · 7 comments

Comments

@JustAPhrog
Copy link

JustAPhrog commented May 10, 2019

Hi, In our company we have one server with APEX and we want to implement this great (!) future. Is it possible to serve multiple manifests for different apps? How to achieve it?
APEX 18.2 on Tomcat on Linux
ORDS 18.4.0.r3541002

@vincentmorneau
Copy link
Owner

Yes, you can name the manifest json file and service worker javascript file anything, and reference those different files in your different apps ;)

@JustAPhrog
Copy link
Author

@vincentmorneau It's great to hear it. I'll try it 🙂

@Habouassaf
Copy link

Hello i know this is an old post
@JustAPhrog did you try this? i couldn't make it works for multiple apps

@vincentmorneau
Copy link
Owner

What's the problem?

Instead of naming manifest.json and sw.js, you can do:

app1manifest.json and app1sw.js
then
app2manifest.json and app2sw.js

@Habouassaf
Copy link

Habouassaf commented Aug 3, 2020

thank you for the replay
i did what you mentioned but the problem is once i installed one application i can't install the other one
in both manifest files i defined start_url and scope like :
"start_url": "https:/myserver/pls/apex/f?p=175:1",
"scope": "https:/myserver/pls/apex/f?p=175",
and in the other
"start_url": "https:/myserver/pls/apex/f?p=1000:1",
"scope": "https:/myserver/pls/apex/f?p=1000",

when i try to install the second app beforeinstallprompt event not triggered and if i force click on install button this error raised:
Uncaught TypeError: Cannot read property 'prompt' of undefined
at Object.pwa.install (app.js:175)

@vincentmorneau
Copy link
Owner

Sorry, this isn't enough for me to debug.

.prompt is a function of the service worker object. If the message is "Cannot read property 'prompt' of undefined" that means the app service worker has not been registered. You need to understand the logic of the JS files, copy paste is not enough.

I've been using this library lately: https://github.com/pwa-builder/pwa-install which works quite well at browser compatibility messages and instructions.

@Habouassaf
Copy link

thank u for your time i will check this library,
and just to know in my case service workers registered,activated and running correctly :) in both apps push notification, cashing , online offline notification all are running just fine, except for the install button in second app not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants