Giter Club home page Giter Club logo

cordova-server-sync's People

Contributors

ericafenyo avatar mrozuru avatar shankari avatar

Watchers

 avatar  avatar  avatar

cordova-server-sync's Issues

AsyncTask's onPostExecute not called due to wrong method overriding

The onPostExecute() of the current AsyncTask implementation does not override the superclass' hence the cachedCallbackContext.success() is never called

// cordova-server-sync/src/android/ServerSyncPlugin.java : line 70
            AsyncTask<Context, Void, Void> task = new AsyncTask<Context, Void, Void>() {
               ...

                protected void onPostExecute(Long result) {
                    cachedCallbackContext.success();
                }
            };

The solution was to pass Void as an argument instead of Long . I forked this repo and made the necessary changes however I was not able to add the forked version to my cordova project (e-mission-phone);

Error while adding the forked version.

$ cordova plugin add https://github.com/ericafenyo/cordova-server-sync.git

Failed to fetch plugin https://github.com/ericafenyo/cordova-server-sync.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Error when added to the config.xml

<plugin name="edu.berkeley.eecs.emission.cordova.serversync" spec="https://github.com/ericafenyo/cordova-server-sync.git" />
$ cordova prepare
...
Discovered plugin "edu.berkeley.eecs.emission.cordova.serversync" in config.xml. Adding it to the project
Failed to restore plugin "edu.berkeley.eecs.emission.cordova.serversync" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin https://github.com/ericafenyo/cordova-server-sync.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Move to a callback/plugin architecture

The current sync architecture interface is not clean.

  • On both android and iOS, it calls the usercache directly
  • On android, it calls the code to fix the state machine automatically, which is in the data-collection plugin.
  • On iOS, it is called from the data collection plugin since the sync happens in response to visit changes
  • On both, we read the battery level, which is a data collection thing, and uses the battery wrapper.

Need to do a good design and rework this properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.