Installation
Follow the below steps to start installing the iOS SDK to your app1. Add CocoaPods to Your Project
If your project is using CocoaPods, skip to the next part of this article, Add Gameball Pod.2. Add Gameball Pod
Swift Package Manager
Gameball is also available through Swift Package Manager. To install it, simply search for ‘Gameball’ or add the repo URL: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.Create Global Variable
Create a global GameballApp variable in your viewController to access anywhere within your viewController:
Widget Parameters Description
The API key of the Client account
The language that the SDK should be initialized with (based on the Client’s configuration)
Store name with myshopify.com domain. Used if your app is a mobile app for a Shopify store connected to Gameball
The platform you application used:
ShopifySallaany
Completion block that gets called when the initialization of the SDK is completed
You may also check the sample project here to view full implementation.
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
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 thelang variable in the code snippet.