20steps / cordova-plugin-watch-example Goto Github PK
View Code? Open in Web Editor NEWExample App for 'cordova-plugin-watch' plugin by 20steps
Example App for 'cordova-plugin-watch' plugin by 20steps
In Cordova/Phonegap 4.2, is there supposed to be a reference to the plugin in cordova_plugins.js? I find code for my other plugins, but none to the cordova watch plugin.
When I run the code in browser, Javascript is throwing
Uncaught TypeError: Cannot read property 'plugins' of undefined(index):
and the following codeblock silently hangs my app both in browser and in compiled Xcode:
function SetupListener(){
window.cordova.plugins.Watch.initialize('group.com.example.app, 'myIdentifier');
window.cordova.plugins.Watch.listen('ListenerName', function(message) {
window.open('http://www.example.com/?QueryVar='+message, '_system')});
I've tried uninstall/reinstall, cordova prepare ..
Thanks for this, it looks great. I'm having trouble though - I followed the instructions and got everything seemingly working but the watch and phone apps don't seem to be communicating. I see changing values on the phone but only -1 on the watch.
I set my own team, changed the bundle identifiers and fixed a few problems that resulted from that, enabled groups on all targets, set the same group, entitlements look fine.
I can't think of what I might be missing, any thoughts perchance?
This is a query more than a issue. Do we need to initialize the plugin only once ? Say i send a request from the watch app multiple times, one request for login, then another request for data for certain period etc, how do i use this plugin. Do I need to initialize the plugin once and keep listening for the request from the watch app ? I believe I should be sending information regarding the request in the message in the request. But depending on the request the response seems to vary. So should I create multiple request functions wrapping the request listener ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.