For the complete documentation index, see llms.txt. This page is also available as Markdown.

iOS native app integration

Integrating Appfigurate Library into iOS native apps

iOS native apps can be developed in both Swift and Objective-C.

For Flutter apps, jump to Flutter integration. For React Native apps, jump to React Native integration.

Prerequisites

You must have the following:

  • Xcode 26+

  • iOS SDKs and associated Simulators.

  • AppfigurateSE macOS app.

  • Appfigurate Simulator app installed into one or more iOS Simulators (use the AppfigurateSE macOS app for easy one-click installation).

  • Your iOS app must target iOS 15.0+ in order to link Appfigurate Library.

Add AppfigurateLibrary.xcframework to the iOS app target

Choose one of the following integration methods (all of which are compatible with both Swift and Objective-C):

Add a package dependency File ‣ Add Package Dependencies with the URL https://github.com/electricbolt/appfiguratesdk

Clone the github repo:

git clone 
https://github.com/electricbolt/appfiguratesdk.git

Drag and drop AppfigurateLibrary.xcframework into your project.

Add new app into Appfigurate Simulator

Run Appfigurate in the iOS Simulator.

Tap Add app.

Select app type iOS.

Enter a URL scheme that will be used by Appfigurate to launch your app in order to read or apply configuration. The URL scheme must be 4-64 ASCII characters in length and must be unique to your app. e.g. YOUR-APP-URLSCHEME

Tap Add app.

Output source code snippets

Tap YOUR-APP-URLSCHEME.

The Edit app screen will be displayed.

Under the SWIFT/IOS LIBRARY INTEGRATION section:

Tap Output implementation then tap Clipboard.

Open the macOS Console.app. Select the iOS Simulator device in the left hand pane. Type process:appfigurate in the search box in the top right.

In Appfiguate Simulator app, under the OBJ-C/IOS LIBRARY INTEGRATION section:

Tap Output header then tap Console.

Tap Output implementation then tap Console.

Create APLConfiguration subclass

In Xcode, tap FileNewNew "Configuration.swift" file from Clipboard.

Note: your public key copied into the clipboard in the Output source code snippets section above will be different to the public key in the following example.

Swift Configuration example

The APLConfigurationClass function with C calling convention must be implemented in your app otherwise a linker error will be issued. The recommended place to implement is at the bottom of your APLConfiguration subclass.

In Xcode, add a new Cocoa Touch class, subclassing APLConfiguration, e.g. Configuration

In your apps Configuration.h file, paste the .h header file output to the Console in the section Output source code snippets above.

Objective-C Configuration header example

In your apps Configuration.m file, paste the .m implementation file output to the Console in the section Output source code snippets above.

Note: your public key copied into the clipboard in the Output source code snippets section above will be different to the public key in the following example.

Objective-C Configuration implementation example

The APLConfigurationClass function must be implemented in your app otherwise a linker error will be issued. The recommended place to implement is at the bottom of your APLConfiguration subclass.

Edit Info.plist

In your apps Info.plist file (right click, Open AsSource Code) include the following. Replace the text YOUR-APP-URLSCHEME with your own app's URL Scheme - the same value you added in the section Add new app into Appfigurate Simulator above.

Info.plist example

If you already have an existing CFBundleURLTypes array in your Info.plist file, then insert just the <dict> ... </dict> portion.

UIApplicationDelegate

In your apps AppDelegate.swift/.m file, include calls to APLApplicationOpenURL and APLDidFinishLaunchingWithOptions. Create any missing delegate methods as appropriate.

Swift UIApplicationDelegate example

Objective-C UIApplicationDelegate example

For apps using UIWindowSceneDelegate

If your app has a UIWindowSceneDelegate, in your apps SceneDelegate.swift/m file, include calls to APLApplicationOpenURL. Create any missing delegate methods as appropriate.

Swift UIWindowSceneDelegate example

Objective-C UIWindowSceneDelegate example

Test your iOS app

To test that you've successfully updated your app to use Appfigurate:

  • Compile and run your app to the Simulator instance.

  • Launch the Appfigurate Simulator app.

  • Tap your applications row. The app will be run and made visible, it's configuration read, and then swap back to Appfigurate.

  • Appfigurate's Configure app screen will now be displayed. You can now change the debugLogging and serverURL properties. Tap Apply⌄ to apply the configuration to your app.

Now jump to Supported property types.

Last updated