KhaosT / WatchActionButtonExample

Example for adopting action button support for Apple Watch Ultra

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WatchActionButtonExample

This repo contains a basic example for how to incorporate StartWorkoutIntent to support Apple Watch Ultra's new Action Button.

To adopt the full functionality of action button for a workout app, the app need to have the following:

  1. workout-processing must be part of WKBackgroundModes declared in the watch app's Info.plist file.
  2. var workoutStyle: WorkoutStyle must be annotated with @Parameter (otherwise the Settings app will only show open app action).

Simulator Screen Shot - Apple Watch Ultra (49mm) - 2022-09-10 at 19 04 00

For chaining .result(actionButtonIntent:) to work (along with pause/resume intents, donation override), the app must meet the following criteria:

  • The app must have an active workout session
  • The app must be selected as the workout app by the user from the Action Button settings

References:

About

Example for adopting action button support for Apple Watch Ultra

License:Apache License 2.0


Languages

Language:Swift 100.0%