Skip to main content

Manually

A guide to add Shake to your app without a dependency manager or a build automation tool.

note

By not using a dependency manager like CocoaPods, you won't be able to use the simple pod update Shake command to always pull the latest version of Shake into your app. Instead, you will have to repeat the the first step described below.

Download Shake from GitHub

Visit Shake iOS SDK GitHub repo โ†’ Download ZIP โ†’ copy Shake.framework folder into your Xcode project โ†’ drag the copied Shake.xcframework into Frameworks, Libraries, and Embedded content section of your project Target general settings.

Make sure that Embed&Sign option is selected for the Shake.xcframework.

Initialize Shake

Initialize Shake in the didFinishLaunchingWithOptions callback of your AppDelegate. Replace your-api-client-id and your-api-client-secret with the actual values you have in your workspace settings:

AppDelegate.swift
import UIKit
import Shake
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Shake.start(clientId: "your-api-client-id", clientSecret: "your-api-client-secret")
return true
}
}
note

Some of the Shake features use swizzling. To avoid swizzling conflicts, call Shake.start() before initializing other frameworks.

Now select Product โ†’ Run in the menu bar. This first run will automatically add your app to your Shake Dashboard based on your app bundle ID.

Conditional initialization

We recommend initializing Shake in the entry point of your app. However, depending on your app, you'll want to initialize Shake just in a specific conditions, depending on your app data. You can do it as shown in the example below when your app data is available:

Main.swift
import UIKit
import Shake
class MainVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Main"
if User.isTester() {
Shake.start(clientId: "_client_id_", clientSecret: "_client_secret_")
}
}
}

Visit your Shake dashboard

Follow the instructions there to send your first feedback with Shake and you're all set.

SDK customizations

Now that Shake SDK is in your app and you have sent the first feedback for fun, everything else is optional. As the next step, try the three most popular SDK customizations: