Push Notifications

Integrate your app with Gameball push notifications and interactive in-app messaging.

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 the 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

Handling Push Notifications Integration

First, Implement the HuaweiMessagingService Interface and Implement your logic in the onMessageReceived override the method.

public class HMSNotificationHandler extends HmsMessageService {
    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        // TOOD 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.

Last updated