-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using capacitor to build native Android and iOS mapper apps #2055
Comments
I've used Ionic/Apache Cordova before, IMO is not worth it if you only need access to a specific feature like location. You can add native for each app to handle geo-location and establish a two-way communication with the webview. For iOS I know you can use WKScriptMessageHandler and evaluateJavaScript for two-way communication between JavaScript and Swift. For Android you have Native Bridges. Webviews are not good in terms of performance compared to native code, but it's a good option for doing something quick and cheap. |
Manual Webview / TWAI have never used the approach you suggest - sounds interesting! Info is a bit sparse for how to do this though.
That's about right? Sounds good in theory, but the Android page linked also notes multiple risks in using the useJavascriptInterface. Packaging up as an apk for Android should be pretty easy at least, using bubblewrap. Pwabuilder.com uses this underneath, and can also create iOS app bundles easily too - its a nice site, and free. CapacitorCapacitor is leagues ahead of Cordova in terms of user-friendliness. I have used Capacitor before with success. It abstracts away the mobile development knowledge and generates everything for you. Are there downsides to having Capacitor handle the native / Webview link, as opposed to doing it manually? I'm honestly not sure. Way forwardThis isn't an item we (NAXA, Daniel, or I) will address in the coming months, due to the MdP project, but its very much a nice to have. If you have done this before & are confident it can work nicely for Android and iOS, then I will let you take the lead! I'm sure the team in Brazil would be thrilled to have a themed version of FMTM distributed as an app 😃 |
@emi420 and I have been discussing this offline. Advantages To Using Native Mobile APIsI think this approach (to use the native geolocation & accelerometer) improves user experience in three ways:
Webview WrapperThe proposed approach would be essentially a 'wrapper' app around a PWA. This wrapper will simply run a webview or Trusted Web Activity, containing the FMTM website as a PWA. The advantage of the wrapper is twofold:
Technical SolutionAs discussed above, there are a few approaches to doing this:
|
I've used Apache Cordova + Ionic framework, then they built their own tool for replacing Cordova, that's Capacitor. But I think that adding a whole framework just to get better coordinate precision is not worth it. The approach is similar to using Capacitor but using our own native code:
This will work if the web app is hosted locally in the device, I'm not sure about loading the app directly from the web, but I can take a look. |
Thanks for the info - thats helpful context! I didn't know it was possible to run the web app locally on the device. I wouldn't fully discount Capacitor though!
But if doing it manually is just as easy and you are happy to do it, then we can equally go that route! |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Additional context
The text was updated successfully, but these errors were encountered: