SharePlay Tutorial — Share custom data between iOS and MacOS

Introduction

Final SharePlay demo application.

Project Setup

Adding the Group Activities capability.

Group Activity API

Creating a group activity.
Helper method for activating the activity.
Iterating over the activity’s sessions.
Configuring the messenger and joining the session.
Helper method for sending data.
Sending data after changing the model.

Problems & Solutions

SharePlayTutorialMac[33577:704067] [Default] messageStream:108 Explanation: Decoding message from data Error: Swift.DecodingError.valueNotFound(Any, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: “message”, intValue: nil), CodingKeys(stringValue: “t”, intValue: nil)], debugDescription: “Decoder for value of Swift.Array<SharePlayTutorialMac.SharePlayModel>.self not found.”, underlyingError: nil))

SharePlayTutorial[11806:1823770] [Client] Error requesting initial state: Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service named com.apple.group-activities.conversationmanagerhost was invalidated: failed at lookup with error 159 — Sandbox restriction.” UserInfo={NSDebugDescription=The connection to service named com.apple.group-activities.conversationmanagerhost was invalidated: failed at lookup with error 159 — Sandbox restriction.}

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store