Code Monkey home page Code Monkey logo

Comments (3)

tsubik avatar tsubik commented on August 20, 2024

Hey @edimilsonramos. I am sorry for not responding so long. Do you still have some problems with this plugin? initialize method for android does nothing so far and I need to remove it maybe.

from cordova-plugin-geofence.

andiCR avatar andiCR commented on August 20, 2024

Hello @tsubik , you should call the callbackContext.success("") from the initialize action on the GeofencePlugin execute function, since this is relevant to other platforms. For iOS i need some code to be executed upon plugin initialization. I don't want to have separate code for android and for iOS, and the plugin should behave exactly the same on both platforms, wether it does anything on Android or not.

In my code I do something like this:

  window.geofence.initialize(function(){

    window.geofence.onTransitionReceived = geofenceManager.onTransitionReceived;

    geofenceManager.log("Geofence initialized.");

    // Get current geofences and remove events that have already passed
    window.geofence.getWatched().then(function (geofencesJson) {
        ...
    });

So basically, please add the following to GeofencePlugin.java

@Override
public boolean execute(String action, JSONArray args,
        CallbackContext callbackContext) throws JSONException {
    ...
    } else if (action.equals("initialize")) {
        callbackContext.success("");
    }
    ...
    return true;

}

from cordova-plugin-geofence.

tsubik avatar tsubik commented on August 20, 2024

Fixed via #55

from cordova-plugin-geofence.

Related Issues (20)

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.