User Management
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.
Informing the user about a required game update
If your game requires to be run on only the most recent version you can enforce that using the Spil SDK and SLOT. In SLOT under the version page you have the possibility to define two options:
- Recommended Version: This informs the game and the user that a new recommended version is available in the store. They should not be forced to update to that version.
- Forced Version: This informs the game and the user that in order to continue playing they should update the game from the store.
In order to implement the functionality into your game you only need to listen to the following callback from the Spil SDK: