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
  • Installation
  • To install Firebase Google Play Services dependencies
  • Initialization
  • Initialize GameballApp Instance
  • Widget Parameters Description
  • Profile Languages
  1. Installing Gameball
  2. Flutter

Getting Started

Install the Gameball Flutter SDK into your app

PreviousFlutterNextInitialize Gameball Customer Profile

Last updated 27 days ago

The Gameball SDK for Flutter enables you to use the show Gameball customer profile in your app, track app customer events, and integrate referrals.

Installation

Follow the below steps to start installing Flutter SDK package to your app

  • Install package using flutter

 $ flutter pub add gameball_sdk

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  gameball_sdk: ^2.2.0

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Make sure that you added the INTERNET permission in your application's AndroidManifest.xml and info.plist files

To install Firebase Google Play Services dependencies

Firebase is an integral dependency to the sdk, you'll have to include the following dependencies in your project's pubspec.yaml file

 $ flutter pub add firebase_core
 $ flutter pub add firebase_dynamic_links
 $ flutter pub add firebase_messaging

Then run the flutter pub get command.

It is also required to have a Firebase project configured and linked to your project, follow tutorial on how to integrate with Firebase.

Now in your Dart code, you can use:

import 'package:gameball/gameball_sdk.dart';

Initialization

To create a GameballApp instance you need to call the getInstance method.

  GameballApp gameballApp = GameballApp.getInstance();

Note that you need to have an initialized Firebase App to be able to the use the Referral and Notifications features.

Make sure that you call the following code after connecting with your Firebase project.

await Firebase
    .initializeApp(options: DefaultFirebaseOptions.currentPlatform)
    .then((response){});

Initialize GameballApp Instance

To initialize GameballApp instance in your application class, use the init method which takes the following parameters (replace the braces with your values)

// Using the Gameball instance created
gameballApp.init("{api_key}", "{lang}", "{platform}", "{shop}");

Widget Parameters Description

APIKey string Required

The API key of the Client account


lang string Optional

The language that the SDK should be initialized with (based on the Client's configuration)


shop string Optional Shopify Only

Store name with myshopify.com domain. Used if your app is a mobile app for a Shopify store connected to Gameball


platform string Optional

The platform you application used:

  • Shopify

  • Salla

  • any

Profile Languages

For websites with multiple languages, how you can change Gameball widget language based on active website language. Gameball supports multiple languages for the customer profile widget. The widget language can be changed based on your customer's active language on the website.

Supported Languages & Codes

  • English: en

  • Arabic: ar

  • French: fr

  • Spanish: es

  • German: de

  • Portuguese: pt

  • Polish: pl

  • Italian: it

  • Hungarian: hu

  • Chinese (Traditional, Taiwan): zh-tw

  • Dutch: nl

  • Swedish: sv

  • Norwegian: no

  • Danish: dk

  • Japanese: ja

In order to show the correct language of the widget based on the active language on the website, you just need to use the language code inside the lang variable in the code snippet.

Learn how you can configure the languages on your Gameball account through this .

this
article