Class

INEndWorkoutIntent

Ends the current workout and saves the results.

Overview

SiriKit creates an INEndWorkoutIntent object when the user asks to finish a currently running workout. Finishing a workout stops the workout and records any progress made toward the workout’s goals. Use this intent object to validate the workout parameters.

To handle this intent, the handler object in your Intents extension must adopt the INEndWorkoutIntentHandling protocol. Your handler should confirm the request and create an INEndWorkoutIntentResponse object to indicate that it is possible to end 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 end the workout.

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

End 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 end 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 ending of a workout

Locale

Example 1

Example 2

en

Stop my workout in <appName>

zh_CN

停止<appName>上的跑步

zh_HK

用動動結束健身

zh_TW

<appName>結束訓練

yue_CN

用动动结束健身

ar

نهاية ركوب الدراجة على <appName>

da

stop cykling med <appName>

de

<appName> Training beenden

Beende <appName> Training

es

Detener mi entreno de <appName>

Detén mi rutina de <appName>

fi

Lopeta <appName> harjoitus

<appName> harjoitus on valmis

fr

Terminer ma course <appName>

Arrêter l'entraînement sur <appName>

he

עצור אימון ב<appName>

it

Ferma il mio allenamento in <appName>

ja

<appName>のワークアウトを終了

<appName>のワークアウトをストップ

ko

<appName>에서 달리기 끝내

<appName>으로 수영 종료

ms

Hentikan menunggang basikal dengan <appName>

Hentikan senaman pada <appName>

nb

Stopp treningen i <appName>

Avslutt <appName> treningen

nl

Stop mijn work-out in <appName>

Kun je mijn activiteit in <appName> beëindigen

pt

Parar meu exercício no <appName>

Pare minha atividade do <appName>

ru

Закончить мою прогулку на велике с <appName>

Остановить пробежку в <appName>

sv

stoppa cykling med <appName>

th

หยุดวิ่งด้วย <appName>

หวัดดี Siri หยุดวิ่งใน <appName> ให้ฉันหน่อยสิ

tr

<appName> koşusunu durdur

koşuyu durdur <appName>

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

Topics

Creating the Intent Object

init(workoutName: INSpeakableString?)

Initializes an intent object with the specified workout name.

Specifying Workout Details

var workoutName: INSpeakableString?

The name of the workout.

Relationships

Inherits From

Conforms To

See Also

End a Workout

protocol INEndWorkoutIntentHandling

Handles the completion of a workout.

class INEndWorkoutIntentResponse

Contains your app’s response to an end workout intent.