PWA Workbox third party images not working - progressive-web-apps

I am working with workbox PWA.
The problem: I have cached images from a third party url.
What happens: it caches some images and some images did not cache and I got an error.
TypeError: failed to fetch.
I do not understand why this happened while I am using same url and it does not fecth all images.
https://third-party-url/stage.jpg [failed to fetch]
https://third-party-url/icon_youtube.png [fetch-images]

Related

TWA bases app sometime showing URL and sometime working, even Assetlink.json uploaded properly

I have website (https://www.kriscent.com/product/kart-supermarket/). I created PWA of that after that I uploaded it on Play store by using TWA(Trusted Web Activities), App URL is https://play.google.com/store/apps/details?id=in.kriscent.kartlite.
The URL of website always show in app, So I uploaded the assetlink.json (URL: https://www.kriscent.com/.well-known/assetlinks.json).
After uploading the assetlinks.json, When I run my app, the website URL disappeared but when I switched on other link in the app then the URL shows again.
I don,t know what is happening. Please help me if anybody has idea to resolve this issue.
enter image description here
enter image description here
The problem is that, when navigating to a product detail page, you are using a different origin than the one used to open the Trusted Web Activity and that doesn't have Digital Asset Links setup:
When the application is started, it opens https://www.kriscent.com/, which is correctly validated.
When clicking on a product, the user is take to https://kriscent.com/ (without www), which is a different origin, and is not validated in the Android app.
It is possible to get the Trusted Web Activity to work with multiple origins but, in this case, I'd recommend using a single origin for the initial URL and the navigations, as you will be able to take advantage of using the same service worker, browser storage, etc.

Precache html pages in flutter

I have a list of some HTML pages that i show in my web_view. The problem is that it will load slowly when network is slow or wont show at all if user is offline. So i want to pre-cache all the URLs before navigating to that page. After that I want to load from the cache and navigate through the URLs on swipe. (The Swipe part is done with URLs loading real-time). My question to you is how do I pre-cache every URLs and call it in my web_view later
If you are sure that those pages are static..I have a suggestion for you..
Like you said, you can pre-cache..
Initially, when internet is available you get the code of those URLs using
http package and store it in local storage, say some .txt file.
And then, when you want to show the page in your app, again..as it being static page, you can read the html code from local storage and show it in your app using html package.
Hope it answers your question.

Flutter cache manager: clear cache for specific urls

I have an app where I display network images. I cache the images.
I also cache the profile picture of the user his/her friends. But there is a possibility a user updates his profile picture.
I'm thinking of a system that removes the profile pictures of the friends every 2 days.
All the profile pictures have this url:
https://firebasestorage.googleapis.com/v0/b/myPROJECT.appspot.com/o/profilepicturesFolder%USERID
I'm using the package flutter cache manager.
Is there a possibility to delete all cached images this url:
https://firebasestorage.googleapis.com/v0/b/myPROJECT.appspot.com/o/profilepicturesFolder
I'm currently using this:
await DefaultCacheManager().emptyCache();
(but it removes all images of the whole app out of the cache)
Thanks in advance!
I suppose you are using this library: https://github.com/Baseflow/flutter_cache_manager
You can provide expiration time for each image(in your case 48 hours). After that, file will be removed and trigger update from your back end.
Also seems your library chose not supported to set expiration time easyly,
check https://github.com/Baseflow/flutter_cache_manager/pull/107
You need to provide special header for your images to ensure that cache will work only for 2 days

Firebase SimpleLogin (Facebook) Failing with Ionic on iPhone

I've configured Facebook Login, and it works on desktop browsers. However, when using an actual iPhone connected to my laptop, two things happen:
the first time I enter my login details (with Cordova in-app browser), Facebook gives me this page: http://cl.ly/image/0n3Z083o2H0j
after I close and reopen the app, I look in GapDebug and see a request to something like https://auth.firebase.com/auth/facebook/callback?code=YDFasdfjsdfh893&fb_redirect_uri%22%3A%22file... with an error message "Failed to load resource: You do not have permission to access the requested resource."
It looks like the fb_redirect_uri is trying to get a file path instead of a URL -- is that right? Do I have a data access problem or what?
Not sure exactly what was going on, but I updated AngularFire and FirebaseSimpleLogin and then it worked.

CodeIgniter video files not uploading on web server

I have created a codeigniter application with a file upload feature. This is loaded as my Facebook app in a Canvas page. I have set my allowed types as png,jpg, mp4.
When tested on localhost this works fine and uploads well.
However, when uploaded on my server and installed as my canvas app, when I access my page via apps.facebook.com/myapp, the images are uploaded fine, BUT, when I try to upload a mp4 file, thatwas successfully uploaded on localhost version, it returns the upload error "The filetype you are attempting to upload is not allowed.".
But I have set it as an allowed type.
I tried uploading via the canvas url (www.myapps.com/apps) rather than the canvas page (apps.facebook.com/myapp), but it gives the same problem, it says the type is not allowed.
I thought it might be server not configured so I add AddType video/mp4 .mp4 to the server's and app folder's .htaccess.
Also I made sure that mp4 is added in the mime.php in my codeigniter app.
Just not sure what to do again. It keeps saying it's not allowed, but it is.
Any help would be great. How do I fix this?
Try adding the both mime types in the list in the config folder for codeigniter. Like this.
'mp4' => array('video/mp4', 'application/octet-stream')