To initialize Gameball SDK in your application class, you have two different ways depending on your user status.
Use the init method which takes 2 parameters :
The ApiKey provided by Gameball. Check How can you get your account integration details? to get your ApiKey
The ID of the icon you want to use for notification
If your player is logged in or your application is not user based. Use the init method which takes the following parameters:
The ApiKey provided by Gameball
PlayerUniqueID which is a unique ID that identifies your user
PlayerTypeID which identifies the type of the player. You can ignore this parameter if you have only one player types on your Gameball account. Check What is “Player Type article for more info.
ID of the icon you want to use for notifications
Note: Providing the init method with a new PlayerUniqueId will automatically create a new player in Gameball
GameBallApp.getInstance(getApplicationContext()).init(“<ApiKey>”, <PlayerUniqueID>”, R.mipmap.ic_launcher);GameBallApp.getInstance(getApplicationContext()).init(“<ApiKey>", "<PlayerUniqueID>",<playerTypeID>, R.mipmap.ic_launcher);
Register player method is used to create or update the player details at Gameball. Ideally it is called when your login network call is successful.
registerPlayer(PlayerUniqueId, PlayerTypeId, PlayerAttributes, CallBack)
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.
Each player type has an ID
PlayerAttributes is a builder class which is used to add or update your player info to Gameball. Player object is described in Object Reference section.
callBack is used for providing the developer with the response status
Once the APIKey and PlayerUniqueId have been registered, Gameball views can be made visible to the user.
User data can be updated by using editPlayerAttributes functions. It can be used to change or add information about the player such as display name, gender, joining date, and so on.
editPlayerAttributes(PlayerAttributes playerAttributes, Callback callback)
It takes PlayerAttributes object which is a builder class as mentioned in registerPlayer method description
It takes a callback to provide you with the response