title: Can't get the Cordova cordova-plugin-geofence Plugin to work
body: <p>I am trying to get the Cordova cordova-plugin-geofence Plugin to work. My testing device is a Google Nexus 5 (Android). I followed the steps from the documentation (<a href="https://github.com/cowbell/cordova-plugin-geofence" rel="nofollow">https://github.com/cowbell/cordova-plugin-geofence</a>). It also said I needed Google Play Services on my device. I have that (8.1.15).</p>
  
  <p>I</p>
  
  <ul>
  <li>installed the plugin into a clean PhoneGap project.</li>
  <li>initialized the plugin after the deviceready event.</li>
  <li>added a geofence and started listening for geofence transitions.</li>
  <li>walked in and out the geofence, but nothing happened.</li>
  </ul>
  
  <p>Maybe I am forgetting something, but if I do please tell me. The only file I edited was index.js. And from that file I edited onDeviceReady and receivedEvent:</p>
  
  <pre><code>onDeviceReady: function() {
      app.receivedEvent('deviceready');
      window.geofence.initialize(function() {
          alert('success');
      }, function(err) {
          alert(err);
      });
  },    
  receivedEvent: function(id) {
      var parentElement = document.getElementById(id);
      var listeningElement = parentElement.querySelector('.listening');
      var receivedElement = parentElement.querySelector('.received');
  
      listeningElement.setAttribute('style', 'display:none;');
      receivedElement.setAttribute('style', 'display:block;');
  
      console.log('Received Event: ' + id);
      //add geofence
      window.geofence.addOrUpdate({
          id: 'abc', 
          latitude: 51.808944, 
          longitude: 4.667041, 
          radius: 3, 
          transitionType: 3, 
          notification: { 
              id: 1, 
              title: 'Welcome', 
              text: 'Hello', 
              smallIcon: 'file://img/icon.png', 
              icon: 'file://img/logo.png',
              openAppOnClick: false, 
              vibration: [2000], 
              data: {
                  name: 'foo',
                  lastName: 'bar'
              }
          }
      }).then(function() {
          console.log('Geofence successfully added');
          alert('Geofence successfully added');
      }, function(reason) {
          console.log('Adding geofence failed', reason);
          alert('Adding geofence failed: ' + reason);
      });
  
      //listen for geofences
      window.geofence.onTransitionReceived = function(geofences) {
          geofences.forEach(function(geo) {
              console.log('Geofence transition detected', geo);
              alert('Geofence transition detected: ' + geo);
          });
      };
  }
  </code></pre>
  
  <p>I received the two alerts (success and Geofence successfully added).</p>