protected override IEnumerable <Datum> Poll(CancellationToken cancellationToken) { List <Datum> data = new List <Datum>(); NSError error; HKBloodTypeObject bloodType = HealthStore.GetBloodType(out error); if (error == null) { if (bloodType.BloodType == HKBloodType.ABNegative) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.ABNegative)); } else if (bloodType.BloodType == HKBloodType.ABPositive) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.ABPositive)); } else if (bloodType.BloodType == HKBloodType.ANegative) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.ANegative)); } else if (bloodType.BloodType == HKBloodType.APositive) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.APositive)); } else if (bloodType.BloodType == HKBloodType.BNegative) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.BNegative)); } else if (bloodType.BloodType == HKBloodType.BPositive) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.BPositive)); } else if (bloodType.BloodType == HKBloodType.ONegative) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.ONegative)); } else if (bloodType.BloodType == HKBloodType.OPositive) { data.Add(new BloodTypeDatum(DateTimeOffset.Now, BloodType.OPositive)); } else { throw new Exception("User has not provided -- or has not allowed access to -- their blood type."); } } else { throw new Exception("Error reading blood type: " + error.Description); } return(data); }