PolarActivityApi
public protocol PolarActivityApi
Protocol defining methods to get steps for a given period.
-
getSteps(identifier:AsynchronousfromDate: toDate: ) Get steps for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getSteps(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarStepsData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve steps from.
toDateThe ending date of the period to retrieve steps from.
Return Value
A publisher emitting an array of
PolarStepsDatarepresenting the steps data for the specified period. -
getDistance(identifier:AsynchronousfromDate: toDate: ) Get distance for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getDistance(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarDistanceData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve distance from.
toDateThe ending date of the period to retrieve distance from.
Return Value
A publisher emitting an array of
PolarDistanceDatarepresenting the distance data for the specified period. -
getActiveTime(identifier:AsynchronousfromDate: toDate: ) Get active time for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getActiveTime(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarActiveTimeData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve active time from.
toDateThe ending date of the period to retrieve active time from.
Return Value
A publisher emitting an array of
PolarActiveTimeDatarepresenting the active time data for the specified period. -
Get calories for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getCalories(identifier: String, fromDate: Date, toDate: Date, caloriesType: CaloriesType) async throws -> [PolarCaloriesData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve calories from.
toDateThe ending date of the period to retrieve calories from.
Return Value
A publisher emitting an array of
PolarCaloriesDatarepresenting the calories data for the specified period. -
get247HrSamples(identifier:AsynchronousfromDate: toDate: ) Get 24/7 heart rate samples for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func get247HrSamples(identifier: String, fromDate: Date, toDate: Date) async throws -> [Polar247HrSamplesData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve heart rate samples from.
toDateThe ending date of the period to retrieve heart rate samples from.
Return Value
A publisher emitting an array of
PolarActiveTimeDatarepresenting the heart rate samples data for the specified period. -
getNightlyRecharge(identifier:AsynchronousfromDate: toDate: ) Get nightly recharge for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getNightlyRecharge(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarNightlyRechargeData]Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve nightly recharge from.
toDateThe ending date of the period to retrieve nightly recharge from.
Return Value
A publisher emitting an array of
PolarNightlyRechargeDatarepresenting the nightly recharge data for the specified period. -
get247PPiSamples(identifier:AsynchronousfromDate: toDate: ) Load 24/7 PPi data from a device for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func get247PPiSamples(identifier: String, fromDate: Date, toDate: Date) async throws -> [Polar247PPiSamplesData]Parameters
identifierPolar device ID or BT address
fromDateThe starting date of the period to retrieve 24/7 PPi data from
toDateThe 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.
-
getActivitySampleData(identifier:AsynchronousfromDate: toDate: ) Load activity sample data from a device for a given period.
Requires
Requires SDK feature(s):
PolarBleSdkFeature.feature_polar_activity_dataDeclaration
Swift
func getActivitySampleData(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarActivityDayData]Parameters
identifierPolar device ID or BT address
fromDateThe starting date of the period to retrieve activity sample data from
toDateThe 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.
-
getDailySummaryData(identifier:AsynchronousfromDate: toDate: ) 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_dataDeclaration
Swift
func getDailySummaryData(identifier: String, fromDate: Date, toDate: Date) async throws -> [PolarDailySummary]Parameters
identifierPolar device ID or BT address
fromDateThe starting date of the period to retrieve daily summary data from
toDateThe 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.