AppAmbit: Getting Started with iOS
This guide walks you through setting up the AppAmbit iOS SDK in your application, focusing on AppAmbit Analytics and Crash Reporting.
iOS open source SDK - The full source code, contribution guidelines, apps for testing, and additional technical documentation are available in our public GitHub repository.
1. Prerequisites
The following requirements must be met to use the AppAmbit SDK:
- The iOS project is set up in Xcode 13 or later.
- You are targeting devices running iOS 12.0 or later.
- You are not using any other libraries that offer crash reporting functionality.
- If you are using CocoaPods to integrate AppAmbit, you need CocoaPods version 1.10 or later.
2. Creating Your App in the AppAmbit Portal
- Visit AppAmbit.com.
- Sign in or create an account. Navigate to "Apps" and click on "New App".
- Provide a name for your app. Optionally, upload an image via drag-and-drop.
- Select the appropriate release type and iOS.
- Click "Create" to generate your app.
- Retrieve the App Key from the app Info page.
3. Adding AppAmbit iOS SDK modules
Get the SDK on Cocoapods (recommended) — easiest to keep up-to-date
Releases — direct download from our GitHub
CocoaPods
Add this to your Podfile:
pod 'AppAmbitSdk'
# or specify version
pod 'AppAmbitSdk', '~> 0.1.0'
Then run:
pod install
This will install the newly defined pod and open the .xcworkspace project.
Warning
If you see an error like [!] Unable to find a specification for AppAmbitSdk when running pod install, run pod repo update to get the latest pods from the Cocoapods repository, and then run pod install.
4. Initialize iOS SDK
Add SDK imports so you can use it in your startup code
Swift
import AppAmbit;
Objective-C
#import "AppAmbitSdk/AppAmbitSdk-Swift.h"
Add the following initialization line in your code, replace the <YOUR-APPKEY> for your real apikey
Swift
AppAmbit.start(appKey: "<YOUR-APPKEY>")
Objective-C
[AppAmbit start:@"<YOUR-APPKEY>"];
5. Breadcrumbs (screen navigation)
AppAmbit records screen-change breadcrumbs automatically. To display the intended screen name, set a navigation title; otherwise it will appear in the dashboard using the default view/controller name.
SwiftUI
NavigationStack {
MyView()
.navigationTitle("My View")
}
Objective-C
UIViewController *vc = [UIViewController new];
vc.title = @"My View";
[self.navigationController pushViewController:vc animated:YES];
Warning
It is not recommended to insert the secret apikey directly into the code.