Class

INStartWorkoutIntent

Starts a workout for the user.

Overview

SiriKit creates an INStartWorkoutIntent object when the user asks to start a workout using your app. A start workout intent identifies the type of workout the user selected and any goals for that workout.

To handle this intent, the handler object in your Intents extension must adopt the INStartWorkoutIntentHandling protocol. Your handler should confirm the request and create an INStartWorkoutIntentResponse object to indicate that it is possible to start the workout. For the successful handling of the intent, SiriKit launches your app and passes it an NSUserActivity object that your app must then use to start the workout.

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

Start workout intent attributes

Attribute

Description

Supported by

Siri

Always requires unlocked device

Yes

Example Phrases

There are many ways in which users can ask Siri to start a workout. Table 2 provides a few sample phrases in different languages. You can use these phrases during testing to trigger your intents. This list is not exhaustive and Siri may recognize many other phrases.

Table 2

Siri phrases that trigger the starting of a workout

Locale

Example 1

Example 2

en

Start a run in <appName>

zh_CN

<appName>开始走路

zh_HK

用動動開始跑步

用動動開始健身

zh_TW

<appName>開始跑步

yue_CN

用动动开始跑步

用动动开始健身

ar

ابدأ تمرين الركض في <appName>

da

start en løbetur med <appName>

de

Starte ein Lauftraining in <appName>

Laufen starten in <appName>

es

Inicia una carrera con <appName>

Inicia una rutina de natación en <appName>

fi

Aloita <appName> juoksu

Menen <appName> kävelylle

fr

Démarre un footing avec <appName>

Lance une course à pied en utilisant <appName>

he

תתחיל ריצה באמצעות <appName>

it

Inizia una corsa usando <appName>

ja

<appName>でランニングを開始

<appName>でランニングをスタート

ko

<appName>에서 달리기 시작해

<appName>으로 수영 시작

ms

Mulakan larian pada <appName>

Mulakan mendayung guna <appName>

nb

Start en løpetur med <appName>

Start sykkeltrening i <appName>

nl

Start een hardloopsessie in <appName>

Ik wil beginnen met fietsen met <appName>

pt

Inicia uma corrida usando <appName>

Começar exercício de bicicleta no <appName>

ru

Начать пробежку в <appName>

Старт забега в <appName>

sv

initiera ett 40 sekunder lång fitnesspass

starta upp fitness

th

เริ่มวิ่งด้วย <appName>

เริ่มต้นการปั่นจักรยาน 30 นาทีด้วย <appName>

tr

<appName> ile 5 dakikalık koşu başlat

5 dakikalık <appName> koşusu başlat

In the preceding examples, <appName> represents the name of the app whose Intents extension starts the workout. If your app uses specific names for workouts, you can tell Siri about those names using the INVocabulary class.

Topics

Specifying Workout Details

var workoutName: INSpeakableString?

The name of the workout.

var goalValue: Double?

The numerical goal of the workout.

var workoutGoalUnitType: INWorkoutGoalUnitType

The units associated with the workout goal.

var isOpenEnded: Bool?

A Boolean value indicating whether the workout is open ended.

Relationships

Inherits From

Conforms To

See Also

Start a Workout

protocol INStartWorkoutIntentHandling

Handles the starting of a workout.

class INStartWorkoutIntentResponse

Contains your app’s response to a start workout intent.