Native iOS Sample App
The BFG Native iOS SDK includes a sample project that demonstrates the integration of the BFG SDK for games developed on our native iOS platform. In it, you will find useful code samples that integrate key features of the SDK into your game, such as user authentication, purchasing, ad monetization, and more.
This document is for the Native iOS sample app. If developing in Unity, see the Unity Sample App documentation.
Getting the Sample App
- Download the most up-to-date version of the Native iOS SDK from Big Fish’s GitHub release repo.
- For the SDK release you want to integrate, extract the contents of the gzipped tarball.
- Launch Xcode and select File > Open.
- Browse to your unzipped SDK folder and select BFGSDK.xcworkspace.
- Click Open.
Sample App File Structure
Directory | Description |
---|---|
BigFishScenePack | Contains scene resources and assets for the sample project. |
RaveSocial | Contains Rave plugin. |
bfgResourcesUniversal | Contains universal BFG SDK resources. |
Classes | Contains all class files of the sample project. |
Resources/bfg_gamespecific_resource | Config that contains settings of the sample app or input configurable data. |
Resource/icons and Default | Contains resources for sample project icons. |
Frameworks | Contains the sample project linked frameworks. |
Products | Contains the sample project build results. |
Building the Sample App
Ensure your device is provisioned with Big Fish's developer certifications before attempting to build the sample app.
Building the sample app depends on the hardware your current device is using. Follow the instructions depending on your machine’s hardware below.
Intel Mac Computers
Select a device or simulator and with Xcode, build the project on your local device.
Mac Computers with Apple Silicon (M1, M2, etc)
If you fail to set the destination architecture as outlined below, you may see errors in Xcode related to “Invalid Swift Architecture” while attempting to build the Native iOS Sample App.
Physical Devices:
- In Xcode, go to Product > Destination > Destination Architectures > Show Apple Silicon Destinations.
- Select the physical device you want to run on.
- Clean and build the app to the device.
Simulators:
- In Xcode, go to Product > Destination > Destination Architectures > Show Rosetta Destinations.
- Select the simulator you want to run on (requires newer simulator versions; for example, it works for an iPhone 14 Pro, but not an iPad Pro 11).
- Clean and build the app to the simulator.
Key Feature Implementation
The following table lists the key features that are implemented in the sample project and where you can find the configuration and code for each feature.
Feature | Implementation |
---|---|
Implemented by calling | |
Implemented in BFGUIKitExampleAppDelegate.m in the | |
AppsFlyer initialized in the config file, bfg_config.json | |
Implemented in BFGUIKitExampleAppDelegate.m in the | |
Implemented in BFGGameScreenViewController | |
Implemented in BFGUIKitExampleAppDelegate.m in the | |
Implemented in BFGUIKitExampleAppDelegate.m in the | |
Implemented in BFGUIKitExampleAppDelegate.m in the | |
Implemented in BFGUIKitExampleAppDelegate.m in the |