Creating a custom Group Activity
You have seen that the ShareOrder app lets you add orders which will be displayed on the screen. You will add a group activity for this app that lets participants add orders during a SharePlay session which will appear on every participant's screen. A custom object is required to represent this activity. The steps required to implement this are as follows:
- Add the Group Activities entitlement to the ShareOrder app.
- Create a new structure named
ShareOrder
that conforms to theGroupActivity
protocol, and configure the group activity metadata. - Add a button to the ShareOrder app's user interface and add an action for this button to activate the group activity.
Important Information
You can learn more about creating a custom Group Activity at this link: https://developer.apple.com/documentation/groupactivities/inviting-participants-to-share-an-activity.
Let's start by adding the Group Activities entitlement to the ShareOrder...