Why does a PWA based on Workbox produce an error when launched from the homescreen on iOS 12? - progressive-web-apps

I can run the app in the browser after clearing data, but if I then add it to the homescreen and attempt to relaunch from there, I get a plain page giving the following error:
Safari cannot open the page. The error was: "FetchEvent.respondWith received an error: Returned response is null."
Subsequent launches in the browser then also give that error. I have to again 'clear data' in the browser to get it to work again.
I'm using Workbox v3.6.2 (the latest, at the time of writing), and my iPhone is running iOS 12.
This looks suspicious, but it's a bit over my head (well, the workaround is anyway). It makes me want to try to down grade to iOS11.X again, and/or install Technology Preview 59.

I have this same problems. On iOS 12.0.0 work properly but after updating to version 12.0.1 I have this same error like you. I have test this same application but on two different devices (iPhone) with two different version of iOS.

Looks like there are multiple possible reasons for this error - I've had it twice ;
Occasion 1 : Needed to add a ROOT certificate and set it as Trusted on device.
my conditions;
I was getting the same error on an iPhone 5s with iOS 12 when loading pwapp from local server.
Using self signed certs on a development machine for server.
Not using Workbox.
Not getting problem if loading pwapp from provider hosted server with ssl cert from iOS recognised cert authority.
Turned out it was to do with security certs - (not using a mac so can't debug to the level of network/security issues on the device / direct to fully diagnose).
Fix was to ;
create a self signed root cert and use that for my server.
convert (copy of) root cert .pem file to .der
access .der via safari on the device / add profile, set as trusted.
(Correct way is to do root, intermediary and server certs , use the server cert and serve the root cert via url or email it to email client on device.)
useful links ;
see Getting cert in General->About->Certificate Trust Settings
Occasion 2 : Turns out you have to access the pwapp from the home screen icon at least once while you have access to the server.
To reproduce ;
(networking on)
delete icon from home screen and clear safari history and website data
visit the pwapp url
add to home screen but do not launch
turn off networking
attempt launch from home screen => get the error
turn on networking, launch pwapp from home screen => ok.
close pwapp, turn off networking, launch pwapp from home screen => ok.
So looks like an iOS/Safari/Webkit bug

Related

How to get emulator to stop demanding certificates

I've managed to get the emulator in the WTK to run stand-alone, as a QwertyDevice, and to install apps (with the built-in Install Applications app) from the Apache server on my laptop. However, it's refusing to actually run the apps because it can't find a Certificate (or the Certificate is corrupted).
How do I turn that off? My actual phone, which I'm developing my apps for, warns me but lets me install and use unsigned apps. And I think I can trust my own apps since I'm writing them.
I found mention of a security Xdomain setting in the WTK user guide, and tried the default, trusted, untrusted, and minimum. No effect except a message in the Command Prompt window saying that it's running in the selected domain. It still refuses to run my apps. (Selecting -Xdomain:help in an attempt to get a list of valid domains resulted in "Running in the help domain"!)
How do I get the emulator to OBEY ME and run the apps?

Fiddler Not Capturing Traffic from iOS Device after Update

This morning I was able to capture https traffic on the version of Fiddler I had installed. I was prompted about a Fiddler update available. I clicked the "Next time" option. After closing fiddler and reopening a few minutes later the update was automatically installed (v4.6.20172.31233, 64-bit). Following that update, I am not able to take any traces from my iOS device. I am on a work computer capturing https traffic from my iPhone to monitor a mobile app.
It should also be noted that I'm unable to capture any traffic or visit any web pages on my iPhone when going through the IP and port 8888 setup with Fiddler. Seems like all data is blocked (even when I'm not attempting to capture https with a trusted certificate).
I have attempted a few things:
Went through these steps (which I had done months ago to originally setup fiddler), and it didn't resolve the situation: http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS
I checked my Tools > Options and everything seems to be configured the same as it was previously.
I double, triple and quadruple confirmed that my iPhone's IP Address and port are correctly matching what fiddler shows when I hover the mouse over the "Online" icon. I confirmed that I'm on the same wifi network on both my laptop and iPhone.
I removed the trusted certificate from my iPhone, but could not download a new one because when I go to ipv4.fiddler:8888 the page does not load. "Safari cannot find the page" and neither can Chrome (from my iPhone). FiddlerMachineIP:8888 loads on my laptop browser, but not my iPhone browser. (I didn't post full http:// links on this post because I have a new stack overflow account and it won't let me yet)
I downloaded the certificate plugin for iOS once more.
I reset my Fiddler Root Certificate by selecting Tools > Options > HTTPS tab > Actions > Reset All Certificates.
I attempted step 4 above again, no success
I closed and reopened fiddler multiple times between each step to restart it, but no success.
Restarted my laptop and iPhone (because why not?)
Do you have any suggestions for what else I can try? Any help is much appreciated. The only thing that was changed was the version of Fiddler. After that, I attempted to run through all the steps above. Currently I'm in a situation where I cannot download the certificate to trust on my iPhone. I don't know what is preventing me from doing that step.
Edit: I reinstalled fiddler and went through all the setup pages. It didn't seem to fix the situation. My phone for some reason will not load the page necessary to download the certificate (ipv4.fiddler:8888)
Try checking the certificate's full trust settings at Settings > General > About > Certificate Trust Settings. Make sure the DO_NOT_TRUST_FiddlerRoot is enabled for full trust.
Disable Windows Firewall and try again. I faced the same problem, and it helped.

windows mobile 6 emulator not signed with a trusted certificate error

I´m trying to install a program in the windows mobile 6 emulator, running it as standalone image (PPC_USA.BIN). The program installs sucessfully, but when i try to run it, the error msg is:
The file '' cannot be opened. Either is not signed with a trusted certificate, or one of its components cannot be found. If the problem persists, try reinstalling or restoring the file.
Any suggestions?
The application probably requires that security be lowered. So to be able to run it, the device needs to have security lowered at least to the level at which the user is asked for permission when he/she is running an unsigned executable. In the context of Windows Mobile security, it means that the device's security configuration needs to be set to Two-Tier-Prompt, One-Tier-Prompt or Security-Off (see MSDN for more details).
Changing of the security configuration might require device manufacturer's or operator's assistance.
In some cases it can be done by the user. Some of them are listed below:
If the user has a registry editor application which can run on
the device and can change the device registry (such application
needs to be signed by a certificate which is trusted by the device
though, or the same issue will repeat itself.)
The device has installed Microsoft Windows Mobile development
certificates.
The device allows the user to install the Microsoft Windows
Mobile development certificates.
Of the above, 2 and 3 are more than likely be the case; if so then try the following:
Install Windows Mobile SDK (Here)
Install <WM SDK>/Tools/Security/SDK Development
Certificates/Certs.cab on the device.
Go to <WM SDK>/Tools/PocketPC/Security/Security Configuration and
use one of the cpf file to change the device's security
configuration (see the Readme File located at <WM
SDK>/Tools/PocketPC/Security/Security Configuration/ReadMe.txt)
Hope this helps someone, even-though I'm a year or so late...

Blackberry webview can not connect to internet and/or display a web page

I am creating a simple app using Eclipse and Blackberry JRE 7.0 as per the example given at:
http://docs.blackberry.com/en/developers/deliverables/11958/Configure_a_browser_field_825671_11.jsp
I am trying to load a simple HTML page hosted on a remote server inside browser field in the app.
When running the app on 9930 Simulator I always get the error 'Local connection timeout after 120000 on simulator'. The same remote page shows up fine on the web browser of the same simulator..
I am making sure to start the MDS simulator.
The same link shows up fine in simulator browser. Its only when using browserfield, I am having the problem.
I get the folling error when clicking the icon to launch the app:
Error displaying content for: http://yahoo.com
Error message: java.lang.runtimeException:ApplicationRegistry:wai​tFor
(0xd0fe7d7338fourd7f0d) timeout
....
On waiting further I get the 'Local connection timeout error..
I know that in Android one has to enable internet connection when using the webview in the manifest file - is there any similar setting one has to do in blackberry?
I tried to run the BrowserField demo app on 9930 (JRE 7.0.0) and encounter the same issues as you did. On the other hand, the demo worked fine on 9800 (JRE 6.0.0). I tried again on 9930 and noticed that though I definitely enabled MDS (enabled the 'Launch Mobile Data System Connection Service (MDS-CS) with simulator' in the Run/Debug Configurations in Eclipse), the MDS window didn't appear which seemed very strange.
I googled a little and found this post on BlackBerry's forums. According to this post:
An incorrect version of MDS-CS simulator was included in 7.0. To correct it you can delete it and copy the version from 6.0.
Well done, RIM!
Then, I deleted the MDS folder from JRE 7.0.0 and copied the one from JRE 6.0.0 as described in the aforementioned post. Closed and rerun simulator and voilà, the MDS window appeared. Rerun application, and everything worked like a charm!

android emulator net access stopped after some minutes of working

While working with my app that require network access...
The Android 2.2 emulator's network connection stop working...
The net was working properly but after some time it did not respond on emulator,
while it was working f9 on my system...
I have cross checked the net connections and restarted with the emulator(even created a new avd ). But the problem remains same my net is not working on emulator..
I have also checked the connection with F8 key on emulator...
My app manifest net permission is enabled....
Finally After all I have myself found the solution of to the problem:
It's very common problem that must have been faced by most of android developers....
Recently, while developing an Android Application, I was faced with a situation that wasted 2 hours of my time. The issue was simple, my app was not able to access internet from the Android Emulator.
Initially I thought fixing the issue should have been straight forward, but life is not always that simple.
So what was the real issue because of which my app was not able to access internet? There are multiple reasons because of which this issue could occur. Hence, I decided to document my findings so that other could benefit from it.
There are two main symptoms of no internet connection on android emulator.....
**Only your app is not able to access the internet
**None of the apps are able to access the internet
Lets look at what are the reasons behind each of them.
Only your app is not able to access the internet
If only your app is not able to access the internet on the emulator, check if any other apps are able to access the internet or not. For e.g. you could open up the browser application, visit http://news.google.com/. If the page opens up correctly then problem lies in your app itself and its simple to fix.
Basically, your app needs the Permission to access the internet. This can be done by adding the following line just before the end of tag in AndroidManifest.xml file of your application.
Compile and re-install the app in the emulator and try to access the internet from your app. It should work!
What is the use of uses-permission tag:
Android application can request certain permissions so that they can function properly. Some examples of permissions are, get users location, make a call, access the internet etc. App has to explicitly specify this in the AndroidManifest.xml.
When end users install such an app on their device, the android OS will notify the user that, app is requesting certain permissions. If users are fine with that, then only the app will be installed. Else users can deny the permission and the app will not be installed.
This mechanism is Androids way of implementing security and users privacy!
This is the more tricky situation:
None of the apps are able to access the internet
Now this situation is tricky. There are two reasons because of which this could happen
Proxy server is not configured on the emulator
Incorrect DNS used by the emulator
Setting Up the DNS Server:
emulator.exe -avd 'android1.6' -dns-server 8.8.8.8
The android1.6 is your avd name I created an avd with name android1.6
So just replace android1.6 with your avd name.
Run this code in command prompt after setting the path to tools & platform tools of your android sdk