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
  • Installation
  • Initialization
  1. Installing Gameball
  2. iOS

Getting Started

Install the Gameball iOS SDK into your app

PreviousiOSNextInitialize Gameball Customer Profile

Last updated 1 year 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

Import the SDK into the created pod, using CocoaPods, to setup the Gameball Widget in the best way for your use-case.

In order to use Gameball you must configure a GameballApp.

  • 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",
    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
    }
)

Parameter
Required
Description

apiKey

Required

Client API key

lang

Optional

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".

shop

Optional

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

platform

Optional

Platform used, for example (shopify)

completion

Optional

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

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

here
Add Gameball Pod