Add offline mode to a Flutter Web App - Service Workers/Pwas - google-chrome

I need to transform a Flutter app into a PWA and I'm trying to understand if this is possible without rewriting the code in AngularDart.
I did some research and I found out that first I need my Flutter App to become a Flutter Web App but nothing more.
There is also a StackOverflow question that speaks about this but answers are not complete
How to transform Flutter web app into a PWA?
I found some PWA examples with AngularDart, JS, etc... but nothing about a Flutter PWA.
*On the Flutter for Web homepage they mention PWAs but I didn't understand if it is already a feature or not.

Something to start you off.
Can we use Flutter for PWA (Progressive Web App) ?
https://github.com/flutter/flutter/issues/14868
Google I/O 2019 announced https://flutter.dev/web
Flutter on Web is still in preview, but here's a get started page:
https://flutter.dev/docs/get-started/web

since early 2020, Flutter Web support service worker.
here's the feature on GitHub for your reference.
https://github.com/flutter/flutter/pull/48344

Related

Splitting web-app and mobile-app request in Yii2

I created a restful web-app platform using yii2 framework. It is working with no problems using a browser. Now I'm developing a mobile-app with angular and ionic and I'm searching for some guide to help me splitting the request from browser and app. Using the browser the web-app is configured to have a html view response, how can I detect a mobile-app request to change response in JSON format in each controller/action?
It's my first mobile-app development.
I just fighted this same war this week and I ended up splitting the folders and generating a new yii-app with fresh controllers just for the api.
I tried creating the api folder inside the web backend project, but I had to much problems with redirections, and as I was working from Android emulator fueled by Expo it was almost impossible to reach the api inside my localhost from outside.
At the end in the API REST you just reuse the database connection, rest of files are new. So there is no much to win in placing it in the same folder/project.
By the way, read this documentation: Implementing RESTful Web Service APIs in Yii2
As a code example you could check my yii2 web app: https://github.com/jvidalv/fempoble
And the api that works with the web: https://github.com/jvidalv/api-fempoble

Build PWA application for Android Mobile

I am new in PWA application development. I would like to develop PWA application using Angular 6. Any one please suggest for following questions
1) How can we create PWA application for Android using Angular 6 ?
2) How can i install PWA application android phone (Local Testing) ?
3) What are features will not work in PWA application in Android and IOS comparing to native?
Please suggest !!! Great ! Thanks In Advance
PWA is nothing but a responsive website with a manifest and a service worker, manifest provides the functionality such as an icon, app name, add to home screen options, while service worker provides you a lot of functionality like network calls, notifications etc.
Here are some reference links which you can visit:
https://blog.angulartraining.com/progressive-web-apps-for-angular-6-and-beyond-f7e4b9a2f9fa
https://medium.com/#joseant.ruizsantiago/building-a-pwa-with-angular-6-5735d7308d25
https://developers.google.com/web/fundamentals/web-app-manifest/
https://developers.google.com/web/progressive-web-apps/
https://serviceworke.rs/
https://medium.com/dev-channel/why-progressive-web-apps-vs-native-is-the-wrong-question-to-ask-fb8555addcbb
http://www.learncodeonline.in/blog/list-of-top-advantages-disadvantages-of-progressive-web-apps/
Regarding your question about features of PWA vs Native, please see the answer posted here on stack overflow itself.
I recommend to use pwabuilder https://www.pwabuilder.com/
a project founded by microsoft, community guided.
It does a awesome job for android PWA/TWA
other alternative is bubblewrap

HTML Service - PWA

Sorry for a noob question - as I've just started with web development half a year ago..
I need your help regarding setting my GAS app into a PWA. Is there such a possibility? I struggle to find any really helpful resources on how to create a service workers and manifest files to work correctly. It'd be extremely helpful for me to get trained on the topic.
Thanks.
Having a valid manifest.json will enable your application to add to home screen of Android, iOS - Safari only, Chrome - All desktop OS.
You can use this link to generate manifest.json for your application and keep in the root of your project and link it using index.html like below,
You can use Workbox to generate service worker for your application.
I don't know what your GAS app is but if it is based on HTML/JS/CSS you can try www.pwabuilder.com for this purpose. It will give you the manifest and the service worker to put in your code.
You can also try the Lighthouse extension in Chrome and activate it when you are on your site. It will tell you if you app is PWA compatible and what needs work.

How to build a Today Widget / App Extension with Cordova?

An app I am working on needs a Today Extension / Widget. Are there any resources on how to build one into an Cordova app?
I found this, but it's not written very clearly and from what I understood seems to be a native app that only uses a HTML5 element in the app and widget to display some data :/
Yes you are right, today extension are a native thing. I recently also did a lot of research on how to integrate one into a cordova project dynamically and ended up creating my own cordova-plugin for that. You can find it here, maybe it will be useful for you too! Nevertheless you will have to implement the widget in Swift.
The plugin takes an already developed widget and integrates it in an cordova-ios project on every cordova platform add ios using a hook which parses and modifies the project.pbxproj via the help of cordova-node-xcode.

Paypal api for hybrid mobile app

I am in big dilemma for last few days while studying paypal API for creating an HTML5 based hybrid app that needs to use paypal api for carrying out some transactions.
What I need is I want to use some Paypal API in HTML5 based mobile app, that will finally get bundled into some native app, say for example .apk files.
The problem is :
I have not found a single link that explains that if the paypal provides any api for hybrid app.
I have read their new buttons, name value api, etc. Will any of these will work in my current application when they get deployed as an .apk for android? The thing that makes me worry is that paypal needs redirectURL, so what it will do incase of single page app?
Any links or references are welcome!
I would highly suggest you try Cordova for your App. It does HTML5 in an app format and works very well.
I don't know that you would want to make API calls but your HTML buttons would definitely work. Paypal also has a plugin that would work as well (Cordova is also called Phonegap).
PhoneGap/Cordova will be my recommendation for any hybrid mobile apps.
PayPal has an official plugin for PhoneGap with Android SDK.
Refer https://github.com/paypal/PayPal-Android-SDK-PhoneGap