Using the Game Center player identifier in the PFUser object being analyzed?

I want to use the Apples game center for players to enter my game, but I also want to save additional game data from the players. I want to use the Parse.com service, so I thought about the players entering the Game Center when the game is loading, and then, if it is not already done, store the players, "player ID" in the PFUser object for analysis. Thus, I can store data for the player during parsing.

So my question (finally) is, what is a good way to do this? I am new to iOS, so I was wondering if there are any obvious issues with how I do what I am missing?

Thanks for any advice.

+4
source share
1 answer

This is not a bad way to do this. This way you use a unique identifier for each parsing user, and then storing additional data in Parse is easy. Stages:

  • authenticate user using GameCenter
  • login for parsing with a combination of an automatic identifier or username / password
  • set the new property 'gameCenter ID' for your PFUser in the section

You will encounter data redundancy, although it is worth noting that the PFUser unique identifier is created on the server side and cannot be seeded or changed on the device (even after creation, I believe). Adding a separate field to your user database for storing GKID data will allow you to find and highlight data for a specific user in the future.

Here's the Apple page for GameCenter Documentation

It is also worth noting: you can create a PFUser with an automatic identifier (provided that your user is connected to the Internet), which will be useful for you when saving additional data, so you do not even need to use the GameCenter user ID. This automatic identifier will most likely be stored in the application until the user updates the application, b) uninstall and reinstall the application, or c) perform any other registration / registration process that you have in the application (Parse is your friend ) The main reason for using the GameCenter ID is that it will be the same for the user through installation / updates of devices / applications, etc.

+1
source

Source: https://habr.com/ru/post/1434849/


All Articles