Getting Started
Install the Gameball Android SDK into your app
Gameball's Android SDK enables you to use the show Gameball customer profile in your app, track app customer events, integrate referrals and display Gameball's in-app push notifications.
Setting up Gameball SDK
Follow the below steps to start installing Gameball's Android SDK to your app.
Add JitPack repository to your project's build.gradle (or settings.gradle if you're on newer versions) file.
Add the following dependency to the application's build.gradle file to import Gameball's SDK into your project.
Make sure that you added the INTERNET permission in your application's AndroidManifest.xml file as follows:
To install Firebase Google Play Services dependencies
Gameball SDK uses Firebase Dynamic Links to track referrals and Firebase Messaging for sending push notifications, you'll need to add the following dependencies.
For the latest Firebase SDK (BOM, Cloud Messaging, Deep Links, and Google Services) versions check their release notes.
You also need to add google-services plugin to your application.
App's build.gradle file:
Project's build.gradle file:
Don't forget to include your google-services.json to your app root after registering it to a Firebase project.
Follow this tutorial to learn more on how to register your Android application to Firebase.
When publishing your app, make sure if you are using ProGuard rules, to exclude gameball packages to avoid Reductions/Code obfuscation by adding the following line in the proguard-rules.pro file.
Initialization
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.
Then initialize it as the following:
Widget Parameters Description
APIKey string
Required
The unique identifier for the player whose attributes are being updated.
lang string
Optional
The unique identifier for the player whose attributes are being updated.
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.
Learn how you can configure the languages on your Gameball account through this article.
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.
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.
Last updated