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
  • Initialization
  • Widget Parameters Description
  • Profile Languages
  1. Installing Gameball
  2. iOS

Getting Started

Install the Gameball iOS SDK into your app

PreviousiOSNextInitialize Gameball Customer Profile

Last updated 2 months ago

The Gameball SDK for iOS 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.

Installation

Follow the below steps to start installing the iOS SDK to your app

1. Add Cocoapods to Your Project

If your project is using CocoaPods, skip to the next part of this article, .

  • Open the terminal window

  • Navigate to the root folder of your Xcode project

  • Run the following command in terminal

$ pod init
  • Close Xcode if open then open your project’s newly created .xcworkspace

  • Your project is now using CocoaPods to install dependencies

2. Add Gameball Pod

  • Add the code below in your Podfile which was created by CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
target 'YourAppName' do
           use_frameworks!
           pod 'Gameball',
End
  • Navigate to your project’s root folder in a terminal window

  • Run the command below in terminal

$ pod install
  • Gameball will install several Pods that it has as dependencies.

When the Pod command finishes execution, you will have Gameball installed and ready to use.

Gameball is also available through [Swift Package Manager]. To install it, simply search for 'Gameball' or add the repo URL:

https://github.com/gameballers/gameball-ios.git

Initialization

In order to use Gameball SDK, apply the below step into the created pod, using CocoaPods, to setup the Gameball Widget in the best way for your use-case.

  • Import our pod to your viewController

import Gameball
  • Create a global GameballApp variable in your viewController to access anywhere within your viewController

var gameball: Gameball?
  • Then initialize it as the following:

gameball = Gameball(
    apiKey: "YOUR_API_KEY", // The only required field
    lang: "ar",
    shop: "MyShop", // Required for Shopify clients only
    platform: "iOS",
    completion: { [weak self] in // Completion block when SDK init is completed
        guard let self = self else {return}
        // You can enable showing profile, registering player, etc. see next section
    }
)

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


completion string Optional

Completion block that gets called when the initialization of the SDK is completed

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.

You may also check the sample project to view full implementation.

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

Add Gameball Pod
here
article