cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
265 stars 318 forks source link

manually trigger transition event #134

Open ghost opened 8 years ago

ghost commented 8 years ago

This is a feature proposal, or, if it already exists, would be good to update the README.

It would be nice to be able to manually trigger a transition event for development purposes. Is that possible today? Thanks!

bflopez commented 8 years ago

I just trigger it by mocking the event that I would have used to watch for transition anyways through a button.

$scope.mockGeofence = function(){
    $rootScope.$broadcast('enteredGeofence')
  };

$scope.$on('enteredGeofence', function() {
    //run code here
  });