User Registration

Import Gameball SDK to create or update players data at Gameball on your React native app.

Register player method is used to create or update players at Gameball. It is called when your login network call is successful.

First, import Gameball SDK as following:

import {GameballSdk} from 'react-native-gameball';

then

GameballSdk.registerUser({
      "playerUniqueId": playerId,
      “playerTypeId”: playerTypeId,
      "deviceToken": playerDeviceToken,
      "osType": Platform.OS === 'ios' ? 'ios' : 'android',
      "playerAttributes": {
        "displayName": “Alex”,
        "email": “example@example.com",
        "gender": “m”,
        "mobileNumber":01099999999,
        "dateOfBirth": "2019-08-18T10:11:34.478Z",
        "joinDate":2019-08-18T10:11:34.478Z
       }
}).then(response => console.log(response)) // on success
.catch(error => console.log(error)) // on error

Once the APIKey and playerUniqueId have been registered, Gameball views can be made visible to the user.

Param

Required

Description

Type

playerUniqueId

Required

PlayerUniqueId is a unique ID for you user, for example UUID or username. The PlayerUniqueId is to be provided by the client and must be unique for each user.

String

playerTypeId

Optional

Each player type has an ID

Integer

playerAttributes

Optional

PlayerAttributes is a builder class which you will use to add or update your player info to Gameball. Player object is described in Object Reference section.

Object

deviceToken

Optional

Mobile device token used for push notifications

String

osType

Optional

Operating system of the device running the application

String

Choose an Unchangeable Player Unique ID

Gameball user profile gets created using the playerUniqueId. It is highly recommended to have the unique ID as an identifier that would NEVER be changed. If this unique ID changes for a given player, you risk losing all original data for that player and hence losing their points and rewards on Gameball. Accordingly, it is NOT recommended to use email address or mobile number as the unique ID as both can be changed by the user at anytime.

Last updated