public override bool StopTracking() { SystemLogger.Log(SystemLogger.Module.PLATFORM, "Stopping Tracking"); if (this._tracker != null) { UIApplication.SharedApplication.InvokeOnMainThread (delegate { try { /* deprecated - changes to compile with iOS 7 this._tracker.StopTracker(); this._tracker.Dispatch(); */ this._tracker.Set(GAIFields.SessionControl, "end"); this._tracker.Dispose(); this._tracker = null; SystemLogger.Log(SystemLogger.Module.PLATFORM, "Tracking STOPPED"); } catch (Exception e) { SystemLogger.Log(SystemLogger.Module.PLATFORM, "Error stopping tracker", e); } }); return true; }else return false; }
private GAITracker SharedTracker(string webPropertyID) { if(this._tracker == null) { UIApplication.SharedApplication.InvokeOnMainThread (delegate { this._tracker = GAI.SharedInstance.TrackerWithTrackingId(webPropertyID); SystemLogger.Log(SystemLogger.Module.PLATFORM, "*** GANTracker.SharedTracker instance"); if(this._tracker == null) { SystemLogger.Log(SystemLogger.Module.PLATFORM, "*** Instance returned by GANTracker is NULL. Please check your assembly linking"); } }); } return GAI.SharedInstance.DefaultTracker; }