iOS SDK

πŸ”§ Installation

Bugbattle is distributed through CocoaPods. Open a terminal window and navigate to the location of the Xcode project for your app.

Create a Podfile if you don't have one:

pod init

Open your Podfile and add:

pod 'BugBattle', '>= 4.1.0'

Save the file and run:

pod install

This creates an .xcworkspace file for your app. Use this file for all future development on your application.

The BugBattle SDK is almost installed successfully. Let's carry on with the initialization πŸŽ‰

πŸ‘·β€β™‚οΈ Initialize & configure the SDK

To initialize & configure the BugBattle SDK, simply add the following commented lines to your applicationDidFinishLaunchingWithOptions method or main App class (if you are using SwiftUI) .

Swift
Swift UI
Objective-C
Swift
import UIKit
​
// Import the Bugbattle SDK
import BugBattle
​
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
​
// Add this line to your applicationDidFinishLaunchingWithOptions method.
BugBattle.autoConfigure(withToken: "YOUR_API_KEY")
return true
}
}
Swift UI
import SwiftUI
​
// Import the Bugbattle SDK
import BugBattle
​
@main
struct DemoApp: App {
init() {
// Add this line to the init() method of your app
BugBattle.autoConfigure(withToken: "YOUR_TOKEN")
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Objective-C
#import "BBAppDelegate.h"
​
// Import the Bugbattle SDK
#import <BugBattle/BugBattle.h>
​
@implementation BBAppDelegate
​
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Auto configure the Bugbattle SDK
[BugBattle autoConfigureWithToken: @"YOUR-API-KEY"];
return YES;
}

You are all set now! Run the app and report your first bug πŸŽ‰.

Get your API here.

🀝 Need help?

We are here to help! [email protected]​