Initialize Customer (Register/Identify)
Register or update a customer whenever they log in or register in your app. This allows Gameball to attach events and rewards to the customer profile.Request Parameters
string
required
Unique identifier for the customer. This should never change for a given customer.
CustomerAttributes
Customer attributes built using
CustomerAttributesBuilder.string
Device token for push notifications (FCM or HMS).
PushProvider
Push notification provider:
PushProvider.Firebase or PushProvider.Huawei.string
Optional session token to override the global token for this specific request. Required in upcoming SDK v4.
In Flutter SDK, passing a sessionToken parameter updates the global token. Pass
null to clear, or omit to use the current global token.Validation Rules
InitializeCustomerRequest requires:customerIdcannot be null or empty- If
deviceTokenis provided,pushProvidermust also be specified - If
pushProvideris specified,deviceTokenmust also be provided
CustomerAttributesBuilder Methods
Build customer attributes using the builder pattern:Show Customer Profile (Widget)
Display the Gameball customer profile widget to show rewards, campaigns, and leaderboards:BuildContext
required
The Flutter BuildContext from your widget.
string
The customer’s unique identifier (omit for guest mode).
string
Specific detail to open in the profile.
Hide navigation elements.
bool
Show close button (defaults to true).
string
Close button color in hex format (e.g., “#FF0000”).
Validation Rules
- No required fields (guest mode supported). Provide
customerIdfor authenticated profiles. closeButtonColormust be in hex format (#RRGGBB) if provided