Private beta. In-App Messaging is not yet generally available. To enable it for your workspace, contact your account manager or email support@gameball.co.
Display In-App Messages
One call after you identify the customer, and the Gameball SDK draws your dashboard campaigns over the current Activity: slide-ups, modals, and full screens, triggered by session start or by the events you already send. Messaging is entirely opt-in, so until you call it the module makes no requests, registers no callbacks, and draws nothing. For campaign options, triggers, filters, priority, cooldown, quiet hours, and how the analytics are defined, see In-App Messaging Campaigns.Requirements
Install
Private beta build. The SDK is not published to the public package registries, so the version below is a placeholder. To get the build and its version, contact your account manager or email support@gameball.co.
build.gradle
Application and identify the customer as you do today. Both must happen before messaging starts.
Start Messaging
Call it once you know who the customer is, typically right afterinitializeCustomer. Messages then appear on session start and when you send matching events.
stopInAppMessaging() dismisses anything on screen, clears cached campaigns, frequency history, and stored personalization values, flushes pending analytics, and unregisters the lifecycle callbacks. Call it on logout. It is safe when messaging was never started, and isInAppMessagingStarted() reports the state.
Identifying a different customer through
initializeCustomer while messaging runs switches the module to that customer automatically.Control Display and Actions
Every hook is optional and individually guarded. If yours throws, you lose the override for that call, never the message.InAppMessage exposes campaignId, variationId, name, messageType, header, body, buttons, and isTest. Styling is applied by the SDK and is not exposed to the host.
Actions
GameballMessageAction is a sealed class, so an exhaustive when is safe.
Before an
OpenUrl or Navigate action runs, pending analytics are flushed with an 800ms budget so the click is not lost if the browser or a new Activity takes over.
Events and Purchases
Events you already send throughsendEvent reach the trigger engine automatically, metadata included, so campaign filters work on them. Send numbers as numbers where a campaign compares them.
purchase, with productId, price, currency, and quantity as metadata:
Language
There is no separate language setting for messages. Each sync asks for the customer’s preferred language when your app set one, otherwise thelang given at init, otherwise the device locale. Arabic strings ship with the SDK, and the layout mirrors when the resolved direction is right-to-left.
Push Permission
The request push permission button action requestsandroid.permission.POST_NOTIFICATIONS through the current Activity on API 33 and above and logs the result. On older versions it logs that nothing needs asking. Your manifest must declare the permission for the dialog to appear.
Behavior Reference
These rules are shared with every Gameball SDK and are described in full in In-App Messaging Campaigns. This is what they mean in an Android app.Logging and Troubleshooting
Every decision is logged with a reason and the campaign ID under the tagGameballIAM, on by default. Nothing from this log leaves the device.
Nothing shows at all? Check in order:
init ran with the API key and the customer is initialized, startInAppMessaging was called with a non-blank ID, the campaign is live and targets Android and the customer is in its audience, the sync log lists it, the account cooldown or quiet hours are not suppressing it, and the campaign has not already been shown to this customer. A fresh customer ID resets frequency history while testing.ProGuard and R8
If you minify, keep the SDK and Gson as the SDK’s README already recommends:proguard-rules.pro
API Reference
Launch Checklist
1
Initialize and identify
init with the production API key in Application.onCreate, then initializeCustomer.2
Start and stop messaging
startInAppMessaging(customerId, options) right after the customer is known, and stopInAppMessaging() on logout.3
Wire navigation and permissions
onNavigate wired if any campaign uses navigate, and POST_NOTIFICATIONS declared if any campaign asks for push permission.4
Declare RTL support
android:supportsRtl="true" if you serve right-to-left languages.5
Add keep rules and test
ProGuard keep rules in place for release builds, then run one campaign end to end on a fresh customer ID with
adb logcat -s GameballIAM open.Related Articles
In-App Messaging Campaigns
Campaign options, triggers, delivery rules, and analytics definitions.
Track Events
Send the events your campaigns are triggered by.
Push Notifications
Reach customers when the app is closed.
Go-Live Checklist
Verify the full Android integration before release.