Posts

Post not yet marked as solved
0 Replies
463 Views
Hi, I am writing workout app for WatchOS and want to add activeEnergyBurned sample whenever user has finished exercise in workout. But whenever I add sample to builder it returns that it was successfully added but when checking added samples in Health app, it shows that it is always 0 and also sum of samples is also always 0. Does activeEnergyBurned has some additional requirements because when tried to write basalEnergyBurned it successfully wrote given calories. Writing sample here:     let energyBurnedType = HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)     if energyBurnedType != nil {       let energyBurned = HKQuantity(unit: HKUnit.largeCalorie(), doubleValue: Double(totalCalories))       let energyBurnedSample = HKQuantitySample(type: energyBurnedType!, quantity: energyBurned, start: self.exerciseStart, end: Date())       builder.add([energyBurnedSample]) { (success, error) in         print(success)         print(error)       }     } And reading data that always returns 0: func updateForStatistics(_ statistics: HKStatistics?) {     guard let statistics = statistics else { return }           DispatchQueue.main.async {       switch statistics.quantityType {       case HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned):         let energyUnit = HKUnit.largeCalorie()         let value = statistics.sumQuantity()?.doubleValue(for: energyUnit)         self.activeCalories = Double( round( 1 * value! ) / 1 )         print(value)         return       default:         return       }     }   } Any ideas on what am I missing? I checked my workout recordings and I see that samples get added but doesn't affect total active energy shown in Health app: And here you can see that sample is added:
Posted Last updated
.
Post marked as solved
2 Replies
427 Views
I was following documentation to set up Sign In with Apple for my website but I can't find the button to verify my domain and it seems that without domain verification authorization does not work - Sign In With Apple returns error that Sign-Up not completed.I am using Firebase Auth and have been following their and also Apple documentations step-by-step.Anyone else has experienced this issue?
Posted Last updated
.