Getting started

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

πŸ“˜

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

Add the following line to your podfile:

pod 'AppsPanelSDK'

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 .xcodeprojfile 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.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [AppsPanel sharedInstance].appName = @"YOUR_APP_NAME";
  [AppsPanel sharedInstance].appKey = @"YOUR_APP_KEY";
  [AppsPanel sharedInstance].appSecret = @"YOUR_APP_SECRET";
  [AppsPanel sharedInstance].logLevel = APLogTypeFull;
  [[AppsPanel sharedInstance] startSession];
   /*...*/
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  AppsPanel.sharedInstance().appName = "YOUR_APP_NAME"
  AppsPanel.sharedInstance().appKey = "YOUR_APP_KEY"
  AppsPanel.sharedInstance().appSecret = "YOUR_APP_SECRET"
  AppsPanel.sharedInstance().logLevel = .full
  AppsPanel.sharedInstance().startSession()
	/* ... */
	return true
}

πŸ“˜

There are differents log level : Full, WS, Light, None

We strongly recommend to set logLevel to APLogTypeNone for release.

If you choose to activate location from the back-office, you need to add NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription to your application's Info.plist.

Then, run your application. If you can see web services responses in the Xcode console, you are all set!