I am creating a small test application with HealthKit trying to incorporate manual training into activity circles.
My code is below the screenshot.
From the image below, 178 Cal Other Workout and 83 Cal Rower were created from the Watch Workout app, both showing a green circle next to them (to indicate that they are included in the circle).
The third 188 Cal Outdoor Run workout was created from my test application, but it shows the application icon and there is no green ring and is not in circles?
Note. Prior to upgrading to iOS 9.0.1, there was nothing where the app icon now resides.

code:
HKQuantity *kCal = [HKQuantity quantityWithUnit:[HKUnit kilocalorieUnit] doubleValue:188];
HKQuantity *disance = [HKQuantity quantityWithUnit:[HKUnit meterUnit] doubleValue:2000];
NSDate *startDate = [NSDate dateWithTimeIntervalSinceNow:-3600];
NSDate *endDate = [NSDate dateWithTimeIntervalSinceNow:-60];
HKWorkout *workout = [HKWorkout workoutWithActivityType:HKWorkoutActivityTypeRunning startDate:startDate endDate:endDate duration:3540 totalEnergyBurned:kCal totalDistance:disance metadata:nil];
[self.healthStore saveObject:workout withCompletion:^(BOOL success, NSError * _Nullable error) {
HKQuantity *heartRateForInterval = [HKQuantity quantityWithUnit:[HKUnit unitFromString:@"count/min"] doubleValue:95.0];
HKQuantitySample *heartRateForIntervalSample = [HKQuantitySample quantitySampleWithType:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]
quantity:heartRateForInterval
startDate:startDate
endDate:[NSDate dateWithTimeInterval:60 sinceDate:startDate]];
__weak typeof(self) weakSelf = self;
if(!success)
{
[self.statusLabel setText:[NSString stringWithFormat:@"saveObject: %@", error.localizedDescription]];
}
else
{
[self.statusLabel setText:[NSString stringWithFormat:@"Success"]];
[self.healthStore addSamples:@[heartRateForIntervalSample] toWorkout:workout completion:^(BOOL success, NSError * _Nullable error) {
if(success) {
[weakSelf.statusLabel setText:@"Saved - Added Sample"];
} else {
[weakSelf.statusLabel setText:[NSString stringWithFormat:@"addSamples: %@", error.localizedDescription]];
}
}];
}
}];
source
share