title: Ionic Background Geolocation - start tracking not working in interval
body: <p>I am tracking the device location every 60 seconds. Which means the <code>startTracking()</code> function needs to be placed inside an interval. It seems when I do this, I'm not getting back a request, but in my console it looks like the gps is updating, the request just isn't being called. When I don't place the <code>startTracking()</code> function in an interval, it gets the initial GPS location (obviously) and it's not updating because it's not placed in an interval but the request is being sent.</p>
  
  <p>location-service.ts</p>
  
  <pre><code>startTracking() {
  
      const config: BackgroundGeolocationConfig = {
        desiredAccuracy: 10,
        stationaryRadius: 20,
        distanceFilter: 30,
        debug: false, //  enable this hear sounds for background-geolocation life-cycle.
        stopOnTerminate: false
    };
  
    this.backgroundGeolocation.configure(config)
    .subscribe((location: BackgroundGeolocationResponse) =&gt; {
  
  
    this.lat = location.latitude
    this.lng = location.longitude
    this.bearing = location.bearing
    this.speed = location.speed
    this.accuracy = location.accuracy
    this.timestamp = location.time
  
    this.backgroundGeolocation.finish(); // FOR IOS ONLY
  
    });
  
    this.gpsProvided = this.diagnostic.isLocationAvailable().then(res =&gt; {
      return res;
    });
    this.manifestID = this.events.subscribe('manifestid', maniID =&gt; {
      return maniID
    });
  
    this.backgroundGeolocation.start();
    }
  
  
   stopTracking() {
  
            let url = 'some URL';
            let request = {
                Latitude: this.lat,
                Longitude: this.lng,
                Speed: this.speed,
                Accuracy: this.accuracy,
                Bearing: this.bearing
            };
            let headers = new Headers({ 'Content-Type': 'application/json' });
            let options = new RequestOptions({ headers: headers });
            let body = JSON.stringify(request);
            this.backgroundGeolocation.stop();
            return this.http.post(url,body,options).subscribe((data) =&gt; {
            });
  
   }
  </code></pre>
  
  <p>app.component.ts (without interval)</p>
  
  <pre><code>constructor(){
  this.sendGPSStart()
  this.GPSInterval()
  }
  
  sendGPSStart(){
      this.locationTracker.startTracking();
    }
  
    sendGPSStop(){
      this.locationTracker.stopTracking();
    }
  
  GPSInterval(){
      setInterval(() =&gt; {
  
            this.sendGPSStop() 
  
        })
      }, 60000)
    }
  </code></pre>
  
  <p>app.components.ts (with interval)</p>
  
  <pre><code>constructor(){
  
  this.GPSInterval()
  }
  
  sendGPSStart(){
      this.locationTracker.startTracking();
    }
  
    sendGPSStop(){
      this.locationTracker.stopTracking();
    }
  
  GPSInterval(){
      setInterval(() =&gt; {
  
            this.sendGPSStart()
            this.sendGPSStop() 
  
        })
      }, '60000')
    }
  </code></pre>