Getting started (v5)

How to integrate the Apps Panel iOS SDK in your apps

The Apps Panel iOS SDK is made to work with the Apps Panel Back Office, and provides a set of tools make your developer life easier and access all the features developed by Apps Panel.

This is how to integrate it in your apps.

Installation with Cocoapods

🚧

iOS supported versions

As of the version 5.1, the Apps Panel SDK support iOS 11.0 and earlier.

📘

If you are not familiar with Cocoapods, see the "getting started" Cocoapods guide

Add the following line to your podfile:

use_frameworks!

pod 'AppsPanelSDKv5'

# https://github.com/CocoaPods/CocoaPods/issues/9775
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    end
  end
end

Then, simply run pod install in the terminal, in your project directory. The Apps Panel SDK and its dependencies are added to your project. From now on, use the .xcworkspace file instead of the .xcodeproj file to open your project.

In order to make the SDK communicate with your back-end, a little configuration is necessary. You need to get your application's credentials from the Apps-Panel Back Office. Add the following code in your AppDelegate, replacing uppercase value with your own values.

import AppsPanelSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {    
        try! AppsPanel.shared.configure(
            withAppName: "YOUR_APP_NAME",
            appKey: "YOUR_APP_KEY",
            privateKey: "YOUR_APP_SECRET"
        )

        try! AppsPanel.shared.startSession()

        return true
    }
  
}

According to the project specifications, you may need to custom the base URL of your web services and the sdk base URL. To do so, add the baseURL and sdkBaseURL parameters to the configure method.

Then, run your application. You're ready to use the Apps Panel SDK.

Installation with Swift Package Manager

🚧

iOS supported versions

As of the version 5.1, the Apps Panel SDK support iOS 11.0 and earlier.

📘

If you are not familiar with Swift Package Manager, see the official Apple documentation on how to use Swift Package Manager in Xcode

  1. Add the package to your project:

    • Open your project in Xcode.
    • Select File > Swift Packages > Add Package Dependency....
    • In the "Search or Enter package URL" field, input the following URL: https://github.com/appspanel/SPMAppsPanelSDK.git.
    • Follow the on-screen steps to choose the version of the SDK you want to integrate and add it to your target.
  2. Configuration in AppDelegate:
    Incorporate the SDK into your AppDelegate as previously described:

import AppsPanelSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {    
        try! AppsPanel.shared.configure(
            withAppName: "YOUR_APP_NAME",
            appKey: "YOUR_APP_KEY",
            privateKey: "YOUR_APP_SECRET"
        )

        try! AppsPanel.shared.startSession()

        return true
    }
  
}

According to the project specifications, you may need to custom the base URL of your web services and the sdk base URL. To do so, add the baseURL and sdkBaseURL parameters to the configure method.

  1. Run your application: You are now ready to use the Apps Panel SDK with Swift Package Manager.

There you go! You've now integrated the Apps Panel SDK into your iOS project using Swift Package Manager. Be sure to periodically check for updates to the SDK to benefit from the latest features and fixes.