Initialize Customer (Register / Identify)
UseinitializeCustomer whenever a user logs in, registers, or you need to refresh their profile. This lets Gameball attach events, rewards, and notifications to the correct customer.
Before calling
initializeCustomer,make sure you have already initialized the SDK using Initialize SDKBasic Customer Initialization
Request Parameters
Unique identifier for the customer. This must not change for a given customer.
Customer’s email address.
Customer’s mobile number with country code.
Push notification token (for example, FCM/Huawei token). Required if
pushProvider is set.Push notification provider:
PushProvider.Firebase or PushProvider.Huawei. Required if deviceToken is set.Additional customer attributes such as name, date of birth, custom fields, etc.
Referral code if the customer was referred by another customer.
Referral code if the customer was referred by another customer.
Guest user flag (defaults to
false).Operating system type. Automatically set to
"Android".Optional session token to override the global token for this specific request.
Validation Rules
InitializeCustomerRequest requires:- customerId cannot be empty
- If pushProvider is set, deviceToken is required
- If deviceToken is set, pushProvider is required
Enriching Profiles with Customer Attributes
Use the CustomerAttributes builder to send richer profile data to Gameball.CustomerAttributes Builder
Recommended Usage Flow
1
User Authenticates
Wait until the user has successfully logged in or registered in your app.
2
Build Attributes
Build
CustomerAttributes with all available information (name, contact, custom attributes).3
Initialize Customer
Call
initializeCustomer with a stable customerId and attributes.4
Proceed with Events & Rewards
After initialization succeeds, start tracking events, showing the profile widget, and enabling rewards.