Phone gap keeps going back to index.html after resume - html

I have created an application using phonegap, this application contains many pages, I have a problem after pressing home button and then go back to the application thew application is reset to index.html page and loosing the state when I left the application.
I tested with Android so far.

Related

PWA ERR_FAILED on refresh

I created a PWA with Blazor WebAssembly straight out from the template in the latest Visual Studio 2019. Most of the app is working great and I managed to add the app to my home screen on an Android phone.
My issue now however is that whenever I swipe down/refresh on any page I get the ERR_FAILED page, this is consistent. Always when I swipe down to refresh it gives me this error. The same error happens with an obviously valid URL (same URL was just loaded) when I press F5 in Chrome for the PWA. I get the ERR_FAILED. Any idea what is causing this? The navigation in the app works great otherwise. The app is hosted in a subapp in IIS called "wapp". I am using localStorage to store user data.
ERR_FAILED

How to Disable Page Caching in Trusted Web Activity App?

I created a Trusted Web Activity App for one of my friends.
Link: https://play.google.com/store/apps/details?id=com.grodudes.app
It's working absolutely fine but I am facing a small problem it is showing the cached pages even when the device is online and it causes problem like showing the user is logged out when moving to a different page even though he is logged in. Reloading the page fixes it.
How can I fix it?

sms: and mailto: failure on iPhone Safari Mobile Browser

Problem:
Web page with sms: and mailto: links fail on ios mobile safari browser. A click on the link redirects you to:
Safari cannot open the page because it cannot redirect to locations
starting with "sms:"
or
Safari cannot open the page because it cannot redirect to locations
starting with "mailto:"
These used to work just fine up until around two or three months ago. Now these fail on Apple mobile devices using the Safari browser.
Background:
I create responsive web pages for activity based teams. One of the things we do is provide a team roster. The roster includes links for telephone numbers, SMS text pages and Email.
To keep things simple, we are using simple web pages.
Because of security and privacy concerns, this content is only served via ajax call via node.js server after login. We're using a single node.js Express server to host the website content and manage http/api calls.
Generally a click on the link pushes the mobile device into the appropriate native app for a phone call, SMS text message or email.
This has been working great for a couple of years, on all devices.
Lately we're seeing the problem on iPhones... but...
Here's the really weird part. I've got three teams using this technique.. The failure is only on TWO of the three teams. SMS link works just fine there.
The "tel:" link works fine on all devices.
The failures only occur on two of the three sites for sms: and mailto: on the iphone. Things still work just fine on Android devices, on Windows and on MacOS. The problem is Apple mobile devices.
The two sites that have the failures are Progressive Web Apps, with a manifest.json file and service_worker.js. The site that works fine has neither of those. When I remove the manifest, and turn off the service worker there is no improvement.
All three sites hosted via App engine at Google Cloud. The two sites that fail are only using web_app.appspot.com addressing. The site that functions well is using a real URL, pointing to the app engine location.
Typical Code:
<li>
<div class="userName">Jane Doe</div>
<div class="phoneNumber">321-555-1234</div>
<div class="sms"><img src="../images/crosstxt-icon.jpg"></div>
<div class="email"><img src="../images/email-icon.png"></div>
</li>
I wonder if this will show the issue, if you open this up in the browser of your Apple mobile device:
Click here to create a SMS message.
<br>
Click here to create an email message.
Apparently that's a fail. You don't even get to see the run snippet button on my mobile device.
Testing, more testing...
I just figured out... if I save the site to my mobile device homepage, such that an icon is added to home screen and in display mode, you can NOT see the top URL address bar, nor the Safari options bar on the bottom then the SMS: will fail. If you just open the address in Safari, but don't save the file, then it will work great.
Again, when I'm in Apple Web Application mode, the SMS link fails.
One hack... open the site via Safari mobile browser on the iphone. Save the site to Home Page. Verify the Icon is on the mobile phone. Go to Settings --> Safari --> Advanced --> Website Data, then Delete the site by sliding the content left. Cache storage is clean, but the Icon remains on the mobile screen. Use the Icon to aid in login, but don't save the site again. Note the URL line is visible. SMS will work.
Still testing here...
I tried to build a simple example to show the issue. I was totally unable to get the sample to fail with the error messages above. For reference the test site is here. The test source code is here.
I'm suspecting that the issue revolves around the fact that the two sites in question are both located at a subdomain site. (mywebapp.appspot.com) When the manifest includes all "valid" content the site does appear as a ios Apple Web app without visible URL line... but whenever I'm in that mode, SMS links are a total fail.
With that said, you can control the storage mode via <meta name="apple-mobile-web-app-capable" content="yes"> .
During my testing, I also noticed that whenever the manifest.json file contains // comment marks anywhere the file is ignored by Safari. Normally // comments are not allowed in a .json file, but according the MSN source, they are fine in a manifest.json file.
The choice is
a bit ugly and functional, or
pretty and non-functional
Currently I'm running <meta name="apple-mobile-web-app-capable" content="no">... I get the advantage of a custom icon on the home screen, even though the web app is still obviously inside a mobile browser with top/bottom info lines visible, sigh.

Angular front end: strange Chrome behavior with 2 devices

I have a local Web Site created in Angular 2. I access to my Web Site via: http://192.168.1.17/.
I have this strange situation:
On my phone, I go on my Web site (http://192.168.1.17/).
Then, on my computer, I do the same: I go on my Web site.
Finally, I scroll the web page with my mouse and I see the page scrolling automatically on my phone !
Why there is a communication between my two devices ? Is it a communication coming from Chrome ?
Note: if I 'Inspect' the page in Chrome, I don't see transfer on network in 'Network' tab.

Navigating back to the same Google Chrome page in Windows 8 after accessing another program

I started developing Android apps using Eclipse IDE with Windows 7. In the course of developing I would be constantly consulting SO via Google Chrome and navigating back to Eclipse IDE to try out a solution that I found; and then back to SO if the solution didn't work.
Recently, I bought a computer with Windows 8, and each time I navigate back to Eclipse (which is on a taskbar on desktop) I lose the SO page that I was on and can't return to it.When I navigate to Google Chrome I just get a new page.I know it sounds so simple, but how do I navigate back to the page I was on previously? ....(I have the same problem with Gmail)
(I would like to be able to continue working in the way I did with Windows 7; if that is possible.)
I think I found the answer to my dilemma: Whenever I navigated back to desktop, I did so by "grabbing" the current page from the top and "dragging" it down; thereby destroying it. I should rather, have navigated via the pop-up window in the top left corner of the screen, thereby conserving the present page..(elementary, my dear Watson)