About PWA with SC

Hi Everybody! This is my first post in this forum, but I am using SC since 2009 and there is a challenge to me… Have anyone here tried to create a PWA using SC? In fact what I really need now is not exactly a PWA complete process, but to make my app, when the user opens it in the browser on mobile, creates the application shortcut in the mobile automatically… That is the first part of my challenge.

TIA,

Create a blank app that will test if you are running on a mobile device

$detect = sc_check_mobile();
if ($detect == true) {
sc_redir(‘menu_mobi’);
} else {
sc_redir(‘menu’);
}

In the menu setup set your default app to the blank application

Note the sc_check_mobile(); is probably not detecting new device, you can use the following link to have a better mobile detector

Simplest way to detect a mobile device in PHP - Stack Overflow

2 Likes

It depends on your definition of PWA, but if you follow the description of PWA - Material Design for Bootstrap for instance, then you will see that PWA is not possible with scriptcase.

1 Like

Hi, thanks for answering. In my case I have both app_login and app_menu in a personalized way, I mean, they are 2 blanks with HTML and CSS based on a template to fill my needs. It’s working fine in any device, as you can see in the images:

In mobile:


In laptop/computer:

So what I really need is, when the user opens my app in mobile, I want to create a shortcut in mobile automatically, as all PWA apps do.

Any clues?

Hi @aducom,

Thanks for your answer. It’s true that SC cannot create a PWA application, but my needs are a little different, for a while. See my answer to the previous post:

TIA,

You can still create a blank app that will do the switching and set it as the initial application when you deploy

$detect = sc_check_mobile();
if ($detect == true) {
sc_redir(‘login_mobi’);
} else {
sc_redir(‘login’);
}

From there you redirect to the right menu.

You can also create a global variable if your app have to be aware of the current display mode.

1 Like

I don`t really need this code, once the app is responsive in both login and menu, as I showed you in earlier post. I’m not using the login and menu created by SC. But thank you for your help.

I never tried, but perhaps these links are a first step towards your specs?

https://medium.com/deity-io/web-app-manifests-a-guide-to-get-your-website-on-a-users-home-screen-6baf108538e7

1 Like

Yes, thank you. I’ll tell you my results later.

maybe not what you are searching but let me know if it works for you
what i made was:

  • easyly (cheating, using app inventor) make an android app that stores user and password of the user and the web address of your scriptcase app server www.myserver.com/login.php (the app has and android installer, ca be placed on a app store, and has its own icon on the android mobile screen

  • then the app opens a webviewer (a web browser without url bar and all the stuff, just the web area, so the user thinks that he is whatching an app) the webview points to your web server address login app

  • the android app send user and passwords to your scriptcase login app

  • your scriptcase login app “catches” the user and password and process your login

  • then your user automaticly in one second gets into your scriptcase apps (just as the user would in a web browser but the user feels he is using an android app"

*** the trick… the android app is made using app inventor it is free and super easy to “learn” (you dont learn so much you can make the app in a single evening or so) with a drag and drop sistem, its free and opensource.

if it works for you let me know maybe i can send you an example

best regards

Hi @ferslash, thanks for your answer. I have worked with App Inventor and it is a good option, however it only works on Android devices and in my case I need my app runs in all platforms (Android, IOS, Windows, etc). That’s why I’m trying to create a PWA application.

deary kleyber:

if you get to make your wpa application please share with the community how you made it :smiley:

fer

1 Like

Hi All,

Just coming here to say that now I have my app working as a PWA. Obviously our app in SC is not a totally responsive one, but it gave me good results.
Now I am finish some details about how to install directly on the home screen, but if you add manually to the home screen it will act as a PWA.

Thanks to all for your ideas.

Regards,

kleyber:

i dont want to bother but…
share some code about your solution i think a lot of people will love to see it (at lease i will) :D:D:D:D

It’s possible install a PWA if use chrome navigator in your phone.
I recommended visit:

But keep in mind that SC does not create PWA apps natively. What I had to do was another approach to get what I needed. And it runs on any known browser (chrome, firefox, safari)

In this case:
https://medium.com/@sam20gh/how-to-add-add-to-home-screen-to-your-website-4b07aee02676

¡Hola a todos! Quisiera comentarle a Kley_Derick que recientemente se ha publicado un video de como crear una PWA aquí les dejo el enlace: Scriptcase - Creando PWA para un sistema Scriptcase. sin embargo aunque he seguido todos los pasos no logro integrar todos los requisitos para generar la App, sucede que no identifica mi SERVICE WORKER (adjunto imagen) y supongo es necesario para generar la App, Como Kley_Derick es el que ha logrado crear su PWA quisiera pedir su ayuda para saber que me esta faltando… De antemano gracias.

Theoretically, you can convert any web application into a pwa. It requires that you design your application with mobile in mind, but actually there are a few things you need to arrange. First a manifest file that contains all that is required to build a pwa: the icons, javascript and html (PHP does not run on your mobile obviously). You need an index.html that enables to install the form as an app. You need a scriptcase-less form based upon html / javascript as a ‘starter’ of your application. It is responsible to retrieve your initial app from mobile cache, verify connection with the internet, and then act accordingly. It is less complex then it sounds, but a lot can go wrong. that is why you must test it with lighthouse under chrome. It explains exactly what is missing. There are low-code tools that offer generating a pwa out of the box, but if I understand the demo right, then SC makes use of pwabuilder that can be found on github.

¡Muchas gracias por responder!

Alguna sugerencia de herramientas para generar una PWA listo para usar?