Firebase Cloud Messaging (FCM)
1. Setup
Follow these steps to enable FCM:- Add Firebase to your project following the official guide: https://firebase.google.com/docs/android/setup
- Add FCM dependencies to your app:
- Add your Firebase credentials in the Gameball Dashboard → Admin Settings → Push Notifications.
2. Retrieve Device Token
Use the Firebase Messaging API to obtain the device token and pass it to Gameball during customer initialization.3. Handle Incoming Notifications
Implement a custom FirebaseMessagingService to handle notifications sent from Gameball.Register the service
Huawei Push Kit (HMS)
For Huawei devices without Google Play Services, use Huawei Push Kit.1. Setup
- Configure Huawei Push Kit in AppGallery Connect
- Add Push Kit dependency:
- Add Huawei repository:
2. Retrieve Device Token
For full Huawei setup instructions, refer to:• AppGallery Connect Configuration:
https://developer.huawei.com/consumer/en/doc/hmscore-guides/android-config-agc-0000001050170137• Push Kit Codelab: https://developer.huawei.com/consumer/en/codelab/HMSPushKit/index.html#0
https://developer.huawei.com/consumer/en/doc/hmscore-guides/android-config-agc-0000001050170137• Push Kit Codelab: https://developer.huawei.com/consumer/en/codelab/HMSPushKit/index.html#0
In-App Messaging
Gameball supports several types of in-app engagement:- Profile widget pop-ups
- Native in-app notifications
- Custom in-app messaging templates
Best Practices
1
Request Permissions Thoughtfully
Request notification permission at a meaningful point in the user’s journey, rather than immediately upon app launch.
2
Handle Token Refresh
Always update the device token when it changes (
onNewToken) by calling initializeCustomer with the new token and matching pushProvider.3
Test on Real Devices
Verify push delivery on different Android versions and manufacturers.
4
Send Useful Notifications
Keep notifications relevant and valuable to avoid opt-outs.