Handling Login on Multiple Devices Using Parse iOS

I had a problem with this script to enter the current game project:

  • The user is registered in his account (previously registered PFUser on the Parse server)
  • They play the game for a while and then leave the game (still logged in).
  • They register on another device and lose

I would like to somehow register another device, since there should not be TWO or MORE LOGINs in devices At the same time, because it is a multiplayer game.

How do I know if a user is registered elsewhere? What is the best approach to working with the same user in many places? I want to prevent data overwriting and inconsistency. Thanks in advance.

+4
source share
1 answer

You can create a unique identifier for each installation of your game (only the UUID stored in the userโ€™s default settings). Each time a log is used, update the identifier in your user information stored on the server. When you upload any editing to the server, you can send the identifier and check it with the cloud code (or check the identifier first) to decide if the login saves. How you check depends on what you want to do if you think the login is invalid. A more efficient route is to use the cloud code and send an error response that the application processes to alert the user and log out.

+6
source

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


All Articles