Unable to send data to mirrored session?

I am having trouble getting the new mirroring session API to send data to the companion device.

when starting a workout on my watch I call startMirroringToCompanionDevice and then go onto my iOS workout manager to handle it via the workoutSessionMirroringStartHandler, I set the delegate here and can confirm that it is indeed not nil within that function but when I go to send some data across I get an error saying the remote session delegate was never set up.

I noticed this same behaviour in the WWDC demo and have been unable to find a solution that will allow me to send data across the mirrored session even though I am able to control the workout session state(pause, resume, end) on both Phone and Watch.

Has anyone else encountered this issue? Anyone have a solution?

Answered by DTS Engineer in 768844022

Sending data between a watch app and its companion iOS app via a mirrored workout session is demonstrated in the Building a multi device workout app sample. You might want to give it a try, if not yet. If the sample has the same issue, you can file a feedback report with detailed steps to reproduce the issue, and post your feedback report ID here.

WWDC23-10023

Sending data between a watch app and its companion iOS app via a mirrored workout session is demonstrated in the Building a multi device workout app sample. You might want to give it a try, if not yet. If the sample has the same issue, you can file a feedback report with detailed steps to reproduce the issue, and post your feedback report ID here.

Are you by any chance trying to send data to the other device before the workout has been prepared or started? I ran into this, if you just call the start mirroring method you still can't send any data until you either start the session or prepare it.

See this blogpost I wrote about it for a little more detail: https://nonstrict.eu/blog/2024/hkworkoutsession-remote-delegate-not-setup-error/

Unable to send data to mirrored session?
 
 
Q