PICO Platform Unity SDK
SportService Class Reference

Static Public Member Functions

static Task< SportUserInfoGetUserInfo ()
 Gets a user's basic information and exercise plan. More...
 
static Task< SportDailySummaryListGetDailySummary (DateTime beginTime, DateTime endTime)
 Gets a summary of the user's daily exercise data for a specified period within the recent 90 days. For example, if the period you set is between 2022/08/16 and 2022/08/18, the exercise data generated on 08/16, 08/17, and 08/18 will be returned. More...
 
static Task< SportSummaryGetSummary (DateTime beginTime, DateTime endTime)
 Get a summary of the user's exercise data for a specified period within the recent 24 hours. The period should not exceed 24 hours. More...
 

Detailed Description

SportService provides multiple APIs for you to access users' exercise data from the built-in PICO app — PICO Fitness.

When users are working out with PICO VR headsets, the app records their exercise data, including exercise duration, calories burned, exercise plan, preferences, and more.

With the APIs provided by the service, you can gather data to understand the exercise habits of individuals, thereby providing users with a better exercise experience.

Member Function Documentation

◆ GetUserInfo()

static Task< SportUserInfo > GetUserInfo ( )
inlinestatic

Gets a user's basic information and exercise plan.

Returns
The Pico.Platform.Models.SportUserInfo class containing the following:
  • Gender
  • Birthday
  • Stature: The natural height in centimeters.
  • Weight: The weight in kilograms.
  • SportLevel: 1-low; 2-medium; 3-high.
  • DailyDurationInMinutes: The planned daily exercise duration (in minutes).
  • DaysPerWeek: The planned days for exercise per week.
  • SportTarget: "lose weight" or "stay healthy".

◆ GetDailySummary()

static Task< SportDailySummaryList > GetDailySummary ( DateTime  beginTime,
DateTime  endTime 
)
inlinestatic

Gets a summary of the user's daily exercise data for a specified period within the recent 90 days. For example, if the period you set is between 2022/08/16 and 2022/08/18, the exercise data generated on 08/16, 08/17, and 08/18 will be returned.

Parameters
beginTimeA DateTime struct defining the begin time of the period. The begin time should be no earlier than 90 days before the current time.
endTimeA DateTime struct defining the end time of the period, .
Returns
The Pico.Platform.Models.SportDailySummaryList class containing the exercise data generated on each day within the specified period, including:
  • Id: Summary ID.
  • Date: The date when the data was generated.
  • DurationInSeconds: The actual daily exercise duration in seconds.
  • PlanDurationInMinutes: The planned daily exercise duration in minutes.
  • Calorie: The actual daily calorie burned.
  • PlanCalorie: The planned daily calorie to burn.

◆ GetSummary()

static Task< SportSummary > GetSummary ( DateTime  beginTime,
DateTime  endTime 
)
inlinestatic

Get a summary of the user's exercise data for a specified period within the recent 24 hours. The period should not exceed 24 hours.

Parameters
beginTimeA DateTime struct defining the begin time of the period. The begin time should be no earlier than 24 hours before the current time.
endTimeA DateTime struct defining the end time of the period.
Returns
The Pico.Platform.Models.SportSummary class containing the following:
  • DurationInSeconds: The actual exercise duration.
  • Calorie: The actual calorie burned.
  • StartTime: The start time you defined.
  • EndTime: The end time you defined.