Open the Gameball Profile Widget
Use the Gameball profile widget to show customers their points, rewards, tiers, leaderboards, and history inside your Android app.Before showing the profile widget, make sure the SDK is initialized and the customer has been registered using Initialize SDK and Initialize Customer Profile.
Basic Usage
Create aShowProfileRequest and call showProfile from GameballApp.
Request Parameters
Unique identifier for the customer whose profile will be displayed.
Specific section to open inside the widget (for example,
"details_earn", "details_redeem"). If not set, the main profile view opens by default.Hides the widget navigation bar when set to
true. Defaults to false.Shows a close button within the widget when set to
true. Defaults to false.Hex color string for the close button (for example,
Only applies when
"#FF5733").Only applies when
showCloseButton is true.Custom widget URL prefix for advanced widget customization.
Validation Rules
ShowProfileRequest requires:- customerId cannot be empty
Advanced Configuration
Open a Specific Section
Use openDetail to deep link into a specific section (for example, “earn” details):Custom Close Button
Show a custom-colored close button on the widget:Hide Navigation
Hide the widget’s internal navigation controls:Capture Widget Links
Handle links clicked from within the widget (for example, to open custom screens or deep links):Implementation Examples
Show Profile from a Button
Display the profile widget when the user taps a button.Bottom Navigation Integration
Open the profile widget when the user taps a “Rewards” tab:What the Widget Shows
The profile widget typically includes:Customer Info
Display name, points balance, and tier level.
Reward Campaigns
Available rewards, missions, and how to earn them.
Leaderboard
Customer ranking and top performers.
Transaction History
History of points earned and redeemed.
The content, layout, and branding of the profile widget can be configured from your Gameball dashboard.
Best Practices
1
Make Access Easy
Place entry points to the profile widget in prominent locations (for example, main navigation, profile screen, or a dedicated Rewards tab).
2
Use Badges
Show badges or indicators when a customer has new rewards or achievements to view.
3
Use Deep Linking
Use the
openDetail parameter to open specific sections based on context (for example, after checkout, open the rewards section).4
Handle Errors Gracefully
Always implement the error callback to show friendly messages if the widget fails to load (for example, due to network issues).