Gameball Developers Guide
v4.0
v4.0
  • Introduction
  • Installing Gameball
    • Web
      • Initialize Gameball Customer Widget
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • iOS
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Track Referrals
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Go-Live Checklist
    • React Native
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Flutter
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • Generic Mobile App
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
  • REST API
    • Overview
      • What's New in V4.0
      • Authentication
      • Rate Limiting
      • Status and Error Codes
    • Customers
      • Customer Management
      • Customer Progress
      • Customer Tags
      • Customer Notifications
    • Events
    • Order
      • Order Tracking
      • Order Rewards & History
    • Payment
      • Payment Tracking
    • Transactions
      • Cashback & Redemptions
      • Hold Management
      • Transaction Management
      • Transaction Validation
    • Coupons
    • Configurations
      • Reward Configurations
      • Program Configurations
      • Widget Configuration
    • Leaderboard
    • Batches
      • Batch Creation
      • Batch Management
  • Webhooks
    • Overview
    • Subscribing to Webhooks
    • Webhook Topics
      • Customer's Notifications
      • Customer's Profile Updates
  • Tutorials
    • Tracking Customer Events
    • Redemption Integration
      • Direct debit redemption
      • Coupons Redemption
        • Use Your Own Couponing Engine
        • Gameball Couponing Engine
    • Checkout Integration
    • Build Custom UI Elements
      • Reward Campaigns
      • VIP Tiers
      • Customer Balance
      • Widget Configurations
      • Coupons Customer Experience
      • Customer Notifications
      • Customer Leaderboard
    • Build your Own Notification System
    • Channel Merging Guide
    • Previewing Potential Points Before Purchase
    • Refund
    • Retail & POS Integration with Gameball Loyalty Program
    • Referrals
    • Widget Deep Links
    • Batch APIs usage example
  • Branch.io Integration
  • Adjust Integration
Powered by GitBook
On this page
  • Configure Gameball With Firebase
  • Handling Push Notifications Integration
  • Configure Gameball With Huawei
  • Handling Push Notifications Integration
  1. Installing Gameball
  2. Android

Push Notifications

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

PreviousIntegrate RedemptionNextGo-Live Checklist

Last updated 1 month ago

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 , 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 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
    }
}
class NotificationsHandler: FirebaseMessagingService() {
    override fun onMessageReceived(message: RemoteMessage) {
        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.

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
    }
}
class MyHuaweiMessagingService : HmsMessageService() {
    override fun onMessageReceived(remoteMessage: RemoteMessage) {
        // TODO Handle Huawei message
    }
}

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.

Follow guide to learn more on how to Set up a Firebase Cloud Messaging client app on Android and guide to learn more on how to Receive messages in an Android app.

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

this
this
Configuring App Information in AppGallery Connect-Preparations-Android-Push Kit - HUAWEI Developers
Pushkit codelab
Configure your Firebase account on Gameball for mobile push notifications
here