[英]Nativescript app to receive data from local browser without using a server
We have an angular web application that can go offline using service workers. 我们有一个有角度的Web应用程序,可以使用服务人员使它脱机。 Most of the time it's used offline than online.
在大多数情况下,它是离线使用的,而不是在线使用的。
To print a few info to a portable bluetooth printer (like a receipt), we've created a nativescript app that looks in the downloads folder for files downloaded from the web app. 为了将一些信息打印到便携式蓝牙打印机(如收据)上,我们创建了一个nativescript应用程序,该应用程序在downloads文件夹中查找从Web应用程序下载的文件。 (NB: At the moment we only intend to support android devices. Converting the web-app into nativescript is also out of the question due to time constraints)
(注意:目前,我们仅打算支持android设备。由于时间限制,将网络应用转换为原生脚本也是不可能的)
This works but maybe it's not the best way to do it. 这行得通,但也许不是最好的方法。 We would like to know if it's possible to let our nativescript app listen for data from the browser without using an api server in between them.
我们想知道是否可以让我们的nativescript应用程序在浏览器之间不使用api服务器的情况下侦听来自浏览器的数据。
根据所存储的信息,你可以使用尺寸application-settings
模块或一些本地数据库SQLite的一样( nativescript-sqlite的 ),甚至在本地存储与火力地堡实时数据库的信息(在和启用离线模式init
所讨论这里 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.