PolarActivityApi

public protocol PolarActivityApi

Protocol defining methods to get steps for a given period.

  • Get steps for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getSteps(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarStepsData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve steps from.

    toDate

    The ending date of the period to retrieve steps from.

    Return Value

    A publisher emitting an array of PolarStepsData representing the steps data for the specified period.

  • Get distance for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getDistance(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarDistanceData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve distance from.

    toDate

    The ending date of the period to retrieve distance from.

    Return Value

    A publisher emitting an array of PolarDistanceData representing the distance data for the specified period.

  • Get active time for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getActiveTime(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarActiveTimeData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve active time from.

    toDate

    The ending date of the period to retrieve active time from.

    Return Value

    A publisher emitting an array of PolarActiveTimeData representing the active time data for the specified period.

  • Get calories for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getCalories(identifier: String, fromDate: Date, toDate: Date, caloriesType: CaloriesType) async throws -> [PolarCaloriesData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve calories from.

    toDate

    The ending date of the period to retrieve calories from.

    Return Value

    A publisher emitting an array of PolarCaloriesData representing the calories data for the specified period.

  • Get 24/7 heart rate samples for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func get247HrSamples(identifier: String, fromDate: Date, toDate: Date) async throws -> [Polar247HrSamplesData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve heart rate samples from.

    toDate

    The ending date of the period to retrieve heart rate samples from.

    Return Value

    A publisher emitting an array of PolarActiveTimeData representing the heart rate samples data for the specified period.

  • Get nightly recharge for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getNightlyRecharge(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarNightlyRechargeData]

    Parameters

    identifier

    The Polar device ID or BT address.

    fromDate

    The starting date of the period to retrieve nightly recharge from.

    toDate

    The ending date of the period to retrieve nightly recharge from.

    Return Value

    A publisher emitting an array of PolarNightlyRechargeData representing the nightly recharge data for the specified period.

  • Load 24/7 PPi data from a device for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func get247PPiSamples(identifier: String, fromDate: Date, toDate: Date) async throws -> [Polar247PPiSamplesData]

    Parameters

    identifier

    Polar device ID or BT address

    fromDate

    The starting date of the period to retrieve 24/7 PPi data from

    toDate

    The ending date of the period to retrieve 24/7 PPi data from

    Return Value

    A publisher emitting a list of [Polar247PPiSamplesData] representing the 24/7 PPi data for the specified period.

  • Load activity sample data from a device for a given period.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getActivitySampleData(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarActivityDayData]

    Parameters

    identifier

    Polar device ID or BT address

    fromDate

    The starting date of the period to retrieve activity sample data from

    toDate

    The ending date of the period to retrieve activity sample data from

    Return Value

    A publisher emitting a list of [PolarActivityDayData] representing the activity sample data for the specified period.

  • Load daily summary data from a device for a given period. Daily summary is a cumulative sum for activity per given date.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_polar_activity_data

    Declaration

    Swift

    func getDailySummaryData(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarDailySummary]

    Parameters

    identifier

    Polar device ID or BT address

    fromDate

    The starting date of the period to retrieve daily summary data from

    toDate

    The ending date of the period to retrieve daily summary data from

    Return Value

    A publisher emitting a list of [PolarDailySummary] representing the daily summary data for the specified period.