Gameball Developers Guide
v3.0
v3.0
  • Introduction
  • What's New in V3.0
  • Installing Gameball
    • Web
      • Show 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
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Referrals
      • 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
      • Migration from v1 to v2
    • Flutter
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • 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
    • Retail & Modern POS
      • Initialize Gameball Customer Profile
      • Track Orders & Cashback Reward
      • Track Refunds
      • Enable Redemption
        • Prepare POS for Redemption
        • Using Virtual ID
          • Using Virtual Card
  • REST API
    • Overview
      • Server-Side SDKs
    • Authentication
    • API Reference
      • Customer
      • Event
      • Transactions
      • Order
      • Coupons
      • Leaderboard 👑
      • Notifications 👑
      • Configurations 👑
      • Batches 👑
        • Batch Operations Data
      • OTP
      • Partner 🤝
        • Client 🤝
        • Redemption Rule 🤝
        • Cashback Rule 🤝
    • Webhooks
      • Notifications Webhook
      • Customer Profile Webhook
    • Errors
    • Object Reference
  • Tutorials
    • Build Custom UI Elements 👑
      • Display Reward Campaign Progress
      • Show VIP Tiers
      • Show Customer Points Balance
      • Build Leaderboards
      • Show Notifications Inbox
      • Adapt UI to Configurations
      • Advanced UI Techniques
        • Increase Sales with Cashback UI Elements
        • Derive Engagement with Rewards Campaigns UI Elements
    • Tracking Customer Events
    • Build your Own Notification System
    • Checkout Integration Example
    • Redemption Integration Options
      • Redeem with coupon system
        • Integrate your coupon system
          • Example using e-commerce platform(WooCommerce)
          • Example using a custom coupon system
        • Build couponing experience
          • Using Gameball widget
          • Build custom experience
            • Showing customers available points
            • Allowing customers to create coupons
            • Apply the discount code to your cart
        • Coupon integration reference
      • Redeem with direct debt
        • Get customers points balance
        • Redeem customer points
  • Third Party Integrations
    • Segment Integration
Powered by GitBook
On this page
  • Create a GameballApp instance.
  • Initialize GameballApp Instance
  • Initialize Firebase Push Notifications
  1. Installing Gameball
  2. Android

Initialize Gameball SDK

Create a GameballApp instance.

To create a GameballApp instance you need to call the getInstance method and pass it a Context instance of the current Activity holding the GameballApp.

GameballApp gameballApp = GameballApp.getInstance(getApplicationContext());
val gameballApp = GameballApp.getInstance(applicationContext)

Initialize GameballApp Instance

To initialize GameballApp instance in your application class, use the init method which takes the following parameters:

Parameter

Type

Required

Description

APIKey

string

Yes

Client API key

lang

string

No

Your platform language preference to view Gameball Widget with.

Note: The language provided should be as per configured languages in your account. If not provided the Gameball profile widget will be shown with your account default language

Example: "en", "fr".

platform

string

No

Your platform name

shop

string

No

Your shop name.

// Using the instantiated instance of GameballApp
gameballApp.init("{your API Key}", "{lang}", "{your Platform name}", "{your Shop name}");

//You can access the init method directly as follows
GameballApp.getInstance(getApplicationContext()).init("{your API Key}", "{lang}", "{your Platform name}", "{your Shop name}");
// Using the instantiated instance of GameballApp
gameballApp.init("{your API Key}", "{lang}", "{your Platform name}", "{your Shop name}")

//You can access the init method directly as follows
GameballApp.getInstance(applicationContext).init("{your API Key}", "{lang}", "{your Platform name}", "{your Shop name}")

Initialize Firebase Push Notifications

To be able to use Firebase Push Notifications feature through Gameball you'd need to first initialize firebase device token by calling the following method right after the init method or before the customer registration.

// Using the instantiated instance of GameballApp
gameballApp.initializeFirebase();
// Using the instantiated instance of GameballApp
gameballApp.initializeFirebase()
PreviousGetting StartedNextInitialize Gameball Customer Profile

Last updated 1 year ago