What is a "guest player" in GameKit? - ios

The documentation for GKPlayer mentions a method for creating "guest players":
The concept of guest players is introduced in iOS 9. Guest players are
treated exactly like authenticated players for Game Center multiplayer
purposes. However, guest players cannot earn achievements, post to
leaderboards, or participate in challenges. Create a guest player with
the anonymous​Guest​Player(with​Identifier:​) method.
But the same documentation says there must be an authenticated player before using GameKit. And indeed, pretty much everything GameKit fails if you aren't logged into Game Center.
So what is the purpose of "guest players" and how would you use them?

its like : lets say your friend wants to play a game(that you also play) using your device. In that case your friend can directly play the game without effecting your scores and achievements if he plays as a guest. Its like a temporary way to play a game from someone else GameCenter account but without affecting his/her scores and achievements

Related

can you create multiplayer game on ios without enabling game center

I am trying to understand to what extent the games that have game center enabled are multiplayer games. Please help me understand following questions:
a) Is it possible to create a multi-player game without enabling game-center
b) Can a game with game-center enabled be a single-player game.
Is it possible to create a multi-player game without enabling game-center?
It is definitely possible, but harder to spin up. Without GameCenter, you need to create your own servers, store game sessions, handle game data being transferred from player to player, and other non-trivial things. GameCenter basically says “Don’t worry about all that network and infrastructure, we got it covered. All you need to do is use our framework.”
Can a game with game-center enabled be a single-player game?
Also a yes! You can actually build a game without GameCenter and let you app handle everything. GameCenter is useful here when you want to add a leaderboard, let players compete with other players, enable high scores, etc.

Real-time game matchmaking with friends in iOS

I would like to implement friends-based matchmaking for a real-time game on iOS 8+
I can already use GKMatchRequest to do anonymous matchmaking, but I'm not sure how to let the user attempt to play against someone they already know
Possibilities:
GKMatchRequest.recipients is where you specify players to invite. But where to acquire the GKPlayer objects to pass to this property? All I can find is GKLocalPlayer.loadRecentPlayers(), which covers only 'someone you have played a game with or a legacy game center friend'.
GKMatchMakerViewController offers a UI for the user to send iMessages to people from Contacts. But the UI is confusing- is there are way to do this programmatically?
Facebook has what many users would consider their canonical list of friends. Does the Facebook SDK for iOS offer matchmaking against this list? Matchmaking is mentioned for Instant Games, but not mobile games
3rd party solution. Perhaps there's another SDK that allows listing of a user's friends/contacts followed by an invitation flow to connect them together?
My ideal UI flow would be
Tap 'Play against friends'
Select from a list of your FB friends/iOS contacts
That user receives an iMessage/FB message from which they can install or open the app
If you're still waiting for them by the time they launch the app, you are both connected and the game begins
It's been driving me a bit crazy because it seems like quite a common problem - surely many users would want to play against people they know? - but I can't seem to find a clear solution. It doesn't help that the GameCenter APIs seem to have changed a lot and documentation is a bit sparse

iOS Google Play Games SDK - How to invite friends to social circles?

Apple's Game Center has really gone down the toilet recently so I'm adding support for Google Play Games leaderboards and achievements to my iOS games. I'm displaying the leaderboards myself by downloading the scores using the GPGLeaderboard class. There's a property called "social" that lets me download the scores of friends - "A social leaderboard is a public leaderboard filtered by people within the local player's circles." Is there an API that will let me invite other players to my game so I can see them in these social leaderboards? I'm not sure how people are supposed to set up these social circles?
Check this documentation: Starting a real-time multiplayer game.
Invite players button. Lets the user invite friends to join a game session or specify some number of random opponents for auto-matching. When the player selects this option, your app should display either the built-in player selection user interface (UI) provided by the SDK or a custom UI for player selection.
You might also want to check on this GPGLeaderboard Class Reference wherein leaderboard objects must be created with a leaderboard ID. Once a leaderboard object is created, you may interact with it using the provided set of actions.

How to get Game Center player name on server-side

In our multiplayer mobile game we want to use player names from Game Center. Those player names will be shown in public leaderboards, so we want to ensure on our server that Game Center player name is actually belongs to that specific user.
I have found the way to verify player login to Game Center Setting up third-party server to interact with Game Center. After verifying Game Center login I have verified playerID.
Is there any way to get player name by this PlayerID from Apple?
Or how can I verify player name I get from client belongs to that user?
P.S. Our server is written in Java so any Java code examples would be appreciated.

CloudKit and GameCenter in a game?

I am working on a game. It will use Game Center for multiplayer. I would like to be able to use CloudKit for storing levels and the local CloudKit container for storing game progress. The problem is that this requires to different accounts. Any ideas on how to link them together?
I struggled with this recently when building in syncing to my game Qiktionary. At first I associated single player game data with the currently logged in Game Center player. So when I started working on sync, I was associating the single player game data in CloudKit with the Game Center player by using a separate CKRecordZone (in the private db) for each Game Center player.
I ended up abandoning that approach because it turns out that causes some behaviour that looks to the user like data loss. For example, GC Player A is logged into your game and plays 10 single player games (or in your case, levels). Later they happen to log out of Game Center, and even later than that they come back to your game and since they are logged out, they no longer see their 10 games played. It's not obvious that the game data is there but just "missing" because they are now logged out of GC.
I did some research and most other games don't work like that. Single player game progress is not linked to the logged in Game Center player. Which means that the single player game data in CloudKit shouldn't be linked to the Game Center player either.
This is even how the GKSavedGame API from GameKit works. According to the docs:
Saved games are tied to the iCloud account, not the Game Center account

Resources