Skip to main content
Gameball uses Firebase and Huawei services to deliver maximum experience in your app. This includes push notifications, interactive in-app messaging. This depends on the initialization method mentioned earlier here, retrieving either Firebase or Huawei device tokens.

Configure Gameball With Firebase

Before you start, you must configure your Firebase on your Gameball account. Follow the steps in Configure your Firebase account on Gameball for mobile push notifications article from our Help Center related to push notifications.

Handling Push Notifications Integration

First, Implement the FirebaseMessagingService Interface and Implement your logic in the onMessageReceived override method.
public class FCMNotificationHandler extends FirebaseMessagingService {
    @Override
    public void onMessageReceived(@NonNull RemoteMessage message) {
        super.onMessageReceived(message);
        //TODO Handle received notification
    }
}
Then, Register the service under application tag in the app’s Manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application>
        <activity>
            ...
        </activity>
        <service
            android:name=".FCMNotificationHandler"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>

</manifest>
Your customers can now receive push notifications from Gameball Through Firebase FCM.
Follow this guide to learn more on how to Set up a Firebase Cloud Messaging client app on Android and this guide to learn more on how to Receive messages in an Android app.

Configure Gameball With Huawei

Follow these guides on how to integrate with Huawei Push Kit services:

Handling Push Notifications Integration

First, Implement the HuaweiMessagingService Interface and Implement your logic in the onMessageReceived override method.
public class HMSNotificationHandler extends HmsMessageService {
    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        // TODO Handle Huawei message here
    }
}
Then, Register the service under application tag in the app’s Manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application>
        <activity>
            ...
        </activity>
        <service
            android:name=".HMSNotificationHandler"
            android:exported="false">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>

</manifest>
Your customers can now receive push notifications from Gameball through Huawei Push Kit.

Next Steps