Is there a way to add a PWA to Home Screen in the Test-Run Setup and Remove it from Home Screen in the Test-Run Teardown - progressive-web-apps

I am developing a PWA from scratch, using TDD approach. I also need PWA to be added to Home Screen in order to be able to use the https://web.dev/periodic-background-sync/ API. In order to be able to isolate each test-run (not having to worry about previous test-run's service worker instance to get in the way) it seems logical to start each test run with adding the PWA being developed to the Home Screen and finish the test-run with removing the PWA from the Home Screen.
Is there a way to do that automatically? For example, using Appium?
Is there an example of doing this?

Related

new builds showing old pages on ionicframework

I have created a ionic react app for cross-platform mobile apps , and using https://dashboard.ionicframework.com/ to generate builds
on home page, changed complete design and data.
now when I generate new build, for ios/android first it shows updated page and data
but when I refresh screen with pull to refresh it changes back to old design and data
and some time going to another screen and than coming back to home screen it shows old stuff
while the web version works fine
don't know whats happening here
You need to do ionic build first then npx cap sync.It sounds like you haven't build it yet.

Ionic capacitor hybrid mobile application

I want to create a hybrid mobile app using ionic capacitor. When user logs in the app should open the main angular app in a hidden webview to initialize the angular app. The webview should be hidden for this time. After this when a user clicks on any links in mobile app, it should open in the webview and this time the webview should be displayed. The webview should open in the app container and not in the browser window (like InApp browser). Please help me if anybody have explored this kind of solutions.
My existing app is built using Xamarin and its built on the above concept.
I have tried the InApp browser but it does not give a good impression to the end user expecting a complete mobile app.
What you want to do is more or less possible if I've understood you well. I've done it in my job. We have a ionic app, but then there are some native screens developed natively for Android (with Java) and iOS (with Swift). With ionic you can call native code from Javascript. For that you need to make your own local Capacitor plugin: https://capacitorjs.com/docs/plugins/creating-plugins
In a plugin, the ionic Javascript function will trigger a native function (Java/Kotlin for Android - Swift/ObjectiveC for iOS). Once there, you can freely create native screens (Android = Activity, iOS = Storyboard/Controller) and then launch your native screens in the app. In our project most of the app is ionic, but we developed our own native screens such as a PDF Viewer, a Web browser, a QR scanner, etc.
But an app is not like a website, an app is a stack of screens. Which means that everytime you access a new screen, it's added to the top of the stack and the user can go back to the previous one. So, ionic will launch first. Inmediately after starting the app (or whenever you want) you can move the user to a native (android/ios) screen. However, if the user presses the native android back button, he will come back to ionic. If you want to prevent that, you need to code that behavior yourself (google android prevent back button). Likewise, you "can't" make the user go from the native screen to ionic, you can bring him back to ionic by navigating back programmatically.
Perhaps you can also change the launch activity to use a different one, and then later launch the ionic activity with native code. But I haven't done this myself and it could break ionic, so I can't advice you through this path.
I hope my answer helps, but I'm not sure I understood what you want to accomplish.

Will every change in Ionic force the customers to update the Ionic app again and again?

If I make changes to the HTML/CSS/JS code of my ionic code, will the customer have to update the app or will it be updated dynamically?
As far as I know, we just push a website into an app and deploy it. When we change the code of your website and deploy it, the website changes show up automatically.
I wonder if Ionic runs the same way? Some people suggest that it is just running the app in a web view. So the app is intact, I change the website, what will it do?
I really want to know about this because we are trying to modernise our application. Our application depends on the server too much for view rendering and for all the logic. I want to make the client a little independent but at the same time keep the changes dynamic like they are right now.
Thank you so much.

Running an ionic app inside ionic app

Is there any way to develop the main app with logins using ionic and develop subparts of that app as individual apps and use the main app to access the sub-apps and pass the login info to sub apps.
Draw.io Flow Diagram For Better idea 1
One ionic app can launch another through the InAppBrowser, for instance. Or socialsharing plugin, etc. And then you need to pass on variables through the launch code. And then going back again.
But the UI experience will be awefull this way if functionally the apps actually are quite similar/related/dependent. So from a UI perspective not a very nice thing to do.
So basically, if you manage the code for all these apps, you may be better off integrating as modules/components in one code base. If you don't own the other apps, make sure the UI is smooth.
Regards
Tom

iPhone web-app from home screen always reloads switching between apps

I'm working on a mobile web app (website) that requires you to add it to the home screen. When you open it, and switch to another app, then go back to my web app, the whole app reloads. It shows the splash screen and doesn't even remember where you last were.
Is there a way around this? I can't find any details in the iOS docs.
It seems that this topic will answer your question.
You can't avoid this refresh behavior. You should work with the HTML5 local storage to persist the state of your application and use it when the application is launched to restore his state.
Here is a link to the Safari Developer Library focussing on your question.