HealthStore enableBackgroundDelivery when screen is locked

前端 未结 4 769
栀梦
栀梦 2020-12-29 15:36

Hello I\'m trying to setup the health store observer with background delivery enabled. My problem is that it won\'t deliver anything when the screen is locked. I have simpli

4条回答
  •  北海茫月
    2020-12-29 16:04

    When iPhone is locked, you cannot access healthKit data with any way.

    When iPhone is unlocked but the app is in background, you can only use HKObserverQuery, which is used to know whether some new samples are added or not.

    When iPhone is unlocked and the app is in foreground, you can use everything related to HealthKit Framework.

提交回复
热议问题