Skip to main content
Version: 8.3.x

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.

info

This document is for the Native iOS sample app. If developing in Unity, see the Unity Sample App documentation.

Getting the Sample App

  1. Download the most up-to-date version of the Native iOS SDK from Big Fish’s GitHub release repo.
  2. For the SDK release you want to integrate, extract the contents of the gzipped tarball.
  3. Launch Xcode and select File > Open.
  4. Browse to your unzipped SDK folder and select BFGSDK.xcworkspace.
  5. Click Open.

Sample App File Structure

DirectoryDescription
BigFishScenePackContains scene resources and assets for the sample project.
RaveSocialContains Rave plugin.
bfgResourcesUniversalContains universal BFG SDK resources.
ClassesContains all class files of the sample project.
Resources/bfg_gamespecific_resourceConfig that contains settings of the sample app or input configurable data.
Resource/icons and DefaultContains resources for sample project icons.
FrameworksContains the sample project linked frameworks.
ProductsContains the sample project build results.

Building the Sample App

Pre-Requisite

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)
warning

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:

  1. In Xcode, go to Product > Destination > Destination Architectures > Show Apple Silicon Destinations.
  2. Select the physical device you want to run on.
  3. Clean and build the app to the device.

Simulators:

  1. In Xcode, go to Product > Destination > Destination Architectures > Show Rosetta Destinations.
  2. 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).
  3. 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.

FeatureImplementation

Account Deletion

Implemented by calling [bfgRave requestAccountDeletion].

App Tracking Transparency (ATT)

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method

Ad Attribution

AppsFlyer initialized in the config file, bfg_config.json

Crash Reporting

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method

Customer Service Platform

Implemented in BFGGameScreenViewController showSupport method

Deep Linking

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method

GDPR Compliance

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method

Identity Management & Player Authentication

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method, and BFGRaveViewController.m

In-App Purchasing

Implemented in BFGUIKitExampleAppDelegate.m in the didFinishLaunchingWithOptions method, and BFGInAppPurchaseViewController