'WearOS support for PWA
I'm digging over internet on how to make a PWA app made with react.js run over WearOS, but I do not find any article. Also, the WearOS website is empty of information of this type, as well. Is the WearOS able to run a PWA app? What are the differences between a WearOS PWA app and a normal Android PWA app? If PWA can run on WearOS, all the APIs (GPS, Phone, camera, BT, wifi, etc.) are available to the app?
Solution 1:[1]
Progressive Web Apps are NOT supported since the required WebKit APIs aren't available.
From: https://developer.android.com/training/wearables/wear-v-mobile
Feature: Connectivity
For example, the
android.webkit
APIs aren't supported.
From: https://developer.android.com/training/wearables/data/network-access
Network Access
You can use protocols such as HTTP, TCP, and UDP. However, the
android.webkit
APIs (including theCookieManager
class) are not available. You can use cookies by reading and writing headers on requests and responses.
Solution 2:[2]
Technically you could install Samsungs browser. https://play.google.com/store/apps/details?id=com.sec.android.app.sbrowser&hl=en_GB&gl=US
But you probably won't have access to most of the APIs you are after.
https://stackoverflow.com/a/69551661/1542667
You could also embed a browser component like Gecko https://stackoverflow.com/a/69551661/1542667
But it's probably as much work as implementing a basic wear app, which will be easier for users.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Morrison Chang |
Solution 2 | Yuri Schimke |