---
title: "loadFriends(_:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gklocalplayer/loadfriends(_:)"
---

# loadFriends(_:)

Loads the local player’s friends list if the local player and their friends grant access.

## Declaration

```swift
func loadFriends(_ completionHandler: @escaping @Sendable ([GKPlayer]?, (any Error)?) -> Void)
```

```swift
func loadFriends() async throws -> [GKPlayer]
```

## Parameters

- `completionHandler`: The block that GameKit calls when it completes the request. The block receives the following parameters: The local player and their friends authorization status must be doc://com.apple.gamekit/documentation/GameKit/GKFriendsAuthorizationStatus/authorized. The local player and their friends must use a version of your game with the same bundle ID.

## Mentioned in

Protecting the player’s privacy using scoped identifiers Connecting players with their friends in your game

## Discussion

Discussion If the loadFriendsAuthorizationStatus(_:) method returns GKFriendsAuthorizationStatus.notDetermined, GameKit presents a prompt to the local player requesting access to their friends that may pause your game. GameKit displays the localized reason that you provide for the NSGKFriendListUsageDescription key in the information property list. If you loaded friends who no longer appear in the friends parameter of the completion handler, remove the data for those friends from your game because they no longer grant your game access to that data.

## See Also

### Accessing Friends and Recents

- [loadFriendsAuthorizationStatus(_:)](gamekit/gklocalplayer/loadfriendsauthorizationstatus(_:).md)
- [GKFriendsAuthorizationStatus](gamekit/gkfriendsauthorizationstatus.md)
- [loadFriends(identifiedBy:completionHandler:)](gamekit/gklocalplayer/loadfriends(identifiedby:completionhandler:).md)
- [NSGKFriendListUsageDescription](bundleresources/information-property-list/nsgkfriendlistusagedescription.md)
- [loadChallengableFriends(completionHandler:)](gamekit/gklocalplayer/loadchallengablefriends(completionhandler:).md)
- [loadRecentPlayers(completionHandler:)](gamekit/gklocalplayer/loadrecentplayers(completionhandler:).md)
