I wanna make a wathcapp with Pebble.js but I found that Pebble.js can only send a message. There is no method can I receive a message from my Android APP?
我想用Pebble.js做一个wathcapp,但我发现Pebble.js只能发送一条消息。我的Android APP没有收到消息的方法吗?
1 个解决方案
#1
It is important to understand that Pebble.js apps are already running on the phone. You cannot use AppMessage to communicate with an Android app.
重要的是要了解Pebble.js应用程序已经在手机上运行。您无法使用AppMessage与Android应用进行通信。
You can however use a Web server inside your app and connect to it from the JavaScript (with ajax()
calls or a WebSocket).
但是,您可以在应用程序中使用Web服务器并通过JavaScript(使用ajax()调用或WebSocket)连接到该服务器。
#1
It is important to understand that Pebble.js apps are already running on the phone. You cannot use AppMessage to communicate with an Android app.
重要的是要了解Pebble.js应用程序已经在手机上运行。您无法使用AppMessage与Android应用进行通信。
You can however use a Web server inside your app and connect to it from the JavaScript (with ajax()
calls or a WebSocket).
但是,您可以在应用程序中使用Web服务器并通过JavaScript(使用ajax()调用或WebSocket)连接到该服务器。