Is there any way I can host a JS file in {domain}/file.js?

Hi all! I'm building my Web App using custom components and I'm trying to push notifications to IOs devices. For that, I need to create a service worker and host it in {domain}/sw.js. I am using MagicBells and I am following this doc WebPush SDK - MagicBell

Is there any way I can achieve this?

thanks in advance!

Hello @Gustavo_B!

Very interesting use case. It looks like push notifications is a built in resource for apps.

Here are our docs for Push Notifications, I am not sure if you are able to use a third party site that is hosted on a separate file :sweat_smile:

Are you self-hosted?

I am following up with my team further about adding in JS files to your code base to run this custom service worker.

linking to a related topic:

Hi Jack!

I don't think this works for web apps. I'm making a web app which will be used in mobile devices, not a native mobile app.

Responding the other question:
No, I am not self hosted.

The resource from my screen shot is for a web app :sweat_smile:

Have you tested it out? I am not super familiar with it so I will look around for docs and might have to test it out. It seems that it is set up for web apps that are being viewed on mobile devices via browser :thinking:

If you are not self-hosted, I am pretty sure you won't be able to add in and link js files to your app :sweat:

As bob linked above, even self hosted users may not be able to connect in new files to apps. You might be able to host this third party service provider on another server but I do not know if the push notification action is possible outside of the resource I shared :melting_face:

According to the docs:

Only Retool Mobile apps can contain subscribe queries.

I can send notifications via WebApp, but not receive them :confused:

Yes the docs are correct, the app would have to be Mobile to send a subscribe query to listen for events.

Wait are you saying from a web app you can send push notifications to users, but you want to receive notifications from a third party app/source?

Unfortunately apps can only receive user inputs. A Workflow is able to receive calls to its trigger URL along with a data payload, and it can trigger push notifications!

Let me know if this works for your usecase :crossed_fingers: