Skip to content

Latest commit

 

History

History
287 lines (195 loc) · 10.8 KB

userIdentification.md

File metadata and controls

287 lines (195 loc) · 10.8 KB

User Identification


When a user contacts Gamedock Customer Support they may be asked for a Gamedock user ID. Currently, Gamedock does not require registration for users, and so cannot link an email to a Gamedock 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 Gamedock user ID in-game. For instance, within a settings screen. The Gamedock user ID can be obtained by calling the Gamedock.Instance.GetGamedockUID() method of the Gamedock 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 Gamedock user ID, you can call the Gamedock.Instance.GetGamedockUID() method.

** Unity **

//Get Gamedock User Id
strimng userId = Gamedock.Instance.GetGamedockUID();

//Get Gamedock Device Id
string deviceId = Gamedock.Instance.GetDeviceId();

** AIR **

//Get Gamedock User Id
var userId:String = Gamedock.GetInstance().GetGamedockUserId()

//Get Gamedock Device Id
var deviceId:String = Gamedock.GetInstance().GetDeviceId();

** Cordova **

//Get Gamedock User Id
gamedockSDK.getGamedockUserId();

//Get Gamedock Device Id
gamedockSDK.getGamedockDeviceId();

Find user in the Console

In order to find the user in the console go through the following steps:

  1. Go to Users->User data to retrieve information about a user.
  2. Search the user id in the search bar, either by typing the first few characters or copying and pasting it.
  3. If you want to remember the UID, you can create an Alias for it once you have Searched it.

github pages

  1. The details of each user information section is as follows:
    • Event Profile: Information regarding specific event tracking done by the user.
    • User Profile: Information tailored specifically to certain games.
    • Experiment Status: The current status of the user in relation to experiments that are running in the game (which segments he has fallen into).
    • Wallet: Information related to the wallet details of the user as well as the possibility to change the values of the user's currencies.
    • Inventory: Information related to the inventory details of the user as well as the possibility to change the values of the user's items.
    • History: Overview about all the transaction that the user has done for his Wallet and Inventory.
    • Push Notifications: Information regarding push notifications as well as ability to put the user in different push notification groups.
    • Private Gamestate: Contains the information regarding the private gamestate blob.
    • Public Gamestate: Contains the information regarding the private gamestate blob. This can also be retrieved by other users.
    • Daily Bonus: Information regarding the current progress of the user's daily bonus. It also provides functionality to modify the progress.
    • Convert User: Tool to change the user's UID to a different one.
    • Data: Contains all the data stored by the backend services.
    • Hashes: Information about the user's connected UIDs, Device Ids, and backend generated hashes (used for connection between the different ids).
    • Social Account: Information about the social login status of the user. It also provides functionality to logout the user or to unlink the UID from the social account.

Setting External IDs

Additional external ids can be passed to the SDK in order to provide better tracking and offering the possibility of linking different services on the backend. You can pass additional external ids at SDK initialization if you perform manual initialization for the SDK. This can be done using the following code:

** Unity **

Gamedock.MonoInstance.Initialize(Dictionary<string, string> externalIds = null);

** AIR **

// Only the last parameter (externalId's) is really relevant for this example:
Gamedock.GetInstance().Init(true, true, true, 16, false, "{\"MyExternalPartner\":\"MyExternalId\"}");

** Cordova **

gamedockSDK.initialise(withAgeGate, ageGateOptions, withPrivacyPolicy, environment, externalIds);

External ids can also be set and removed (if necessary) at later stages in the game using the following code:

** Unity **

//Add external Id
Gamedock.Instance.AddExternalId(externalPartner, id);

//Remove external Id
Gamedock.Instance.RemoveExternalId(externalPartner);

** AIR **

//Add external Id
Gamedock.GetInstance().addExternalId("MyExternalPartner","MyExternalId");

//Remove external Id
Gamedock.GetInstance().removeExternalId("MyExternalPartner");

** Cordova **

//Add external Id
gamedockSDK.addExternalId(externalPartner, id);

//Remove external Id
Gamedock.Instance.removeExternalId(externalPartner);

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 the Console

It’s possible for customer support to change the user id of a player through the Gamedock Console. 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:

** Unity **

// Start listening to user id change requests
Gamedock.Instance.InitializationCallbacks.OnUserIdChangeRequest -= OnUserIdChangeRequest;
Gamedock.Instance.InitializationCallbacks.OnUserIdChangeRequest += OnUserIdChangeRequest;

private void OnUserIdChangeRequest(string newuserid) {
  // Update the game to allow the new user id to be used
  
  // Confirm back to the Gamedock SDK to change the user id
  Gamedock.Instance.ConfirmUserIdChange();
}

First, the Gamedock 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 Gamedock SDK should be called to let the Gamedock SDK change the Gamedock SDK and do a full reload of the entire loaded user data.

** AIR **

// Start listening to user id change requests
Gamedock.GetInstance().addEventListener(SDKEvents.REQUEST_USER_ID_CHANGE, onRequestUserIdChangeEvent);

private function onRequestUserIdChangeEvent(evt:RequestUserIdChangeEvent) : void
{
	// Update the game to allow the new user id to be used

	// Confirm back to the Gamedock SDK to change the user id
	Gamedock.GetInstance().ConfirmUserIdChange();
}

First, the Gamedock 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 Gamedock SDK should be called to let the Gamedock SDK change the Gamedock SDK and do a full reload of the entire loaded user data.

** Cordova **

This feature is currently not supported on Cordova.

The Gamedock 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 Gamedock SDK and Console. In Console 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 Gamedock SDK:

** Unity **

Gamedock.Instance.InitializationCallbacks.OnGameVersionStatus -= OnGameVersionStatus;
Gamedock.Instance.InitializationCallbacks.OnGameVersionStatus += OnGameVersionStatus;

public void OnGameVersionStatus(GamedockUnityImplementationBase.UpdateStatus status) {
}

//Possible values for GamedockUnityImplementationBase.UpdateStatus
public enum UpdateStatus {
    Recommended,
    Forced
}

** AIR **

Gamedock.GetInstance().addEventListener(SDKEvents.GAME_VERSION_STATUS, onGameVersionStatusEvent);

private function onGameVersionStatusEvent(evt:GameVersionStatusEvent) : void		
{
	// Possible values for GameVersionStatusEvent.version: "recommended" or "forced".
}

** Cordova **

This feature is currently not supported on Cordova.

Requesting ATTracking permission (IDFA Tracking) for iOS

By default the SDK requests the ATTracking permission for iOS when using the built in GDPR popup. The permission request happens after the user has accepted the GDPR popup. If you want to request the permission manually, independent of the GDPR popup use the following code:

** Unity **

//Register the callback in order to receive the response for the user
//Should be registered before making the request call
Gamedock.Instance.ATTrackingCallbacks.OnATTPermissionStatus -= OnATTPermissionStatus;
Gamedock.Instance.ATTrackingCallbacks.OnATTPermissionStatus += OnATTPermissionStatus;

public void OnATTPermissionStatus(ATTrackingCallbacks.ATTPermissionStatusEnum status)
{
    
}

public enum ATTPermissionStatusEnum
{
    NotDetermined = 0,
    Restricted = 1,
    Denied = 2,
    Authorized = 3
}

//Method to request ATTTracking permission
Gamedock.Instance.RequestATTPermission();

** AIR **

This feature is currently not supported on Cordova.

** Cordova **

//Request permission
gamedockSDK.requestATTPermission();

//Callback
gamedockSDK.on('ATTPermissionStatus', (status) => {
    console.log('ATTPermissions status: ', status);
});