<!--
{
  "availability" : [
    "iOS: 16.2.0 -",
    "iPadOS: 16.2.0 -",
    "macCatalyst: 16.2.0 -",
    "macOS: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchmaker/startGroupActivity(playerHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatchmaker(im)startGroupActivityWithPlayerHandler:"
  },
  "title" : "startGroupActivity(playerHandler:)"
}
-->

# startGroupActivity(playerHandler:)

Begins a SharePlay activity for your game when a FaceTime call is active.

```
func startGroupActivity(playerHandler handler: @escaping (GKPlayer) -> Void)
```

## Parameters

`handler`

The block that GameKit calls when a person using SharePlay wants to join the group activity. GameKit invokes this handler for each player that joins until your app, or the player, stops showing the group activity in SharePlay.

    This block receives the following parameter:

- `player`: A player who wants to join the group activity.

## Discussion

SharePlay lets people share experiences in a group activity, such as joining your game using FaceTime or the Messages app. If you implement a custom group activity interface, use this method to show a group activity that your game provides in apps that support the SharePlay interface. For macOS apps, add the Group Activities capability to your Xcode to enable this feature.

To start a group activity on behalf of the player and receive callbacks for each player that joins, invoke the [`startGroupActivity(playerHandler:)`](/documentation/GameKit/GKMatchmaker/startGroupActivity(playerHandler:)) method. Implement the handler to add each player that joins to the match before starting gameplay using the [`addPlayers(to:matchRequest:completionHandler:)`](/documentation/GameKit/GKMatchmaker/addPlayers(to:matchRequest:completionHandler:)) method.

If an app with a SharePlay interface isn’t running when you invoke the [`startGroupActivity(playerHandler:)`](/documentation/GameKit/GKMatchmaker/startGroupActivity(playerHandler:)) method, GameKit presents an interface that lets the player share a group activity in an app that supports SharePlay. Then the player can stop showing the group activity using the SharePlay interface, or you can stop the group activity on behalf of the player using the [`stopGroupActivity()`](/documentation/GameKit/GKMatchmaker/stopGroupActivity()) method.

Alternatively, if you want to present a familiar GameKit interface, instead present a [`GKMatchmakerViewController`](/documentation/GameKit/GKMatchmakerViewController) object that lets the player start a group activity by selecting SharePlay to invite players.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)