User Identification

When a user contacts Spil Games Customer Support they may be asked for a Spil Games user ID. Currently, Spil Games does not require registration for users, and so cannot link an email to a Spil Games user ID. All users are essentially guest users and, therefore, have an anonymous user ID.

Support for user identification depends on the games platform:

  • Android: developers should show the Spil Games user ID in-game. For instance, within a settings screen. The Spil Games user ID can be obtained by calling the Spil.Instance.GetSpilUID() method of the Spil Games SDK.
  • iOS: no specific action is required. The build script automatically inserts a Settings.bundle file into your Xcode project. This results in the Generic Settings app from Apple being updated and showing some SDK-related option, as well as the user’s ID. If you still want to obtain the Spil Games user ID, you can call the Spil.Instance.GetSpilUID() method.

Setting Customer User IDs

If your game has a way to authenticate users (for example, by using Facebook), ensure that the Custom User ID is set with the Facebook ID, or your own global user ID.

Once the custom user ID and provider have been set, they will be sent with each event. The Spil Games SDK also uses its own generated guest user ID. To configure the Custom User ID and provider, use the following code:

Note that the provider is not strictly defined. Therefore, it does not matter what you pass as long as it is a string (for example, “FB”, ”facebook”, “twitter”, or “myBrand”).

User ID modifications from SLOT

It’s possible for customer support to change the user id of a player through SLOT. This is useful when the user, for example, lost his progress because his previous account could not correctly be retrieved.

See below an example of how to use this feature:

First, the Spil SDK calls the OnUserIdChangeRequest with the new user id. In this callback, the game should prepare the state to allow a user id change. Once this is done the ConfirmUserIdChange() method of the Spil SDK should be called to let the Spil SDK change the Spil SDK and do a full reload of the entire loaded user data.

The Spil SDK will never automatically change the user id when the ConfirmUserIdChange() is never fired the old user id will remain being used.