Carthage

We support integrating Shake into your Xcode project using Carthage.

NOTE

Not using Carthage yet? Follow their brief installation guide, then create an empty Cartfile in the root of your project and you're done — let's move on.

Install Shake via Carthage

Open your Cartfile and add this line:

Cartfile
binary "https://github.com/shakebugs/shake-ios/raw/master/Shake.json"

Next, open up Terminal and enter this command:

carthage update

Link Shake library

Once carthage update is executed, you will find the Shake binary in your project folder inside:

🗂 Carthage → 🗂 Build → 🗂 iOS → ◻️ Shake.framework

Open Xcode and select your project file in the left section of the screen. Under General scroll down to the Frameworks, Libraries and Embedded Content section and drag-and-drop ◻️Shake.framework there. Make sure Embed & Sign is selected.

Add Client ID and Secret to Info.plist

Open your workspace and in the Project Navigator, right click on Info.plist, and Open as › Source code. Paste this but replace your-api-client-id and your-api-client-secret with the actual values you have in your workspace settings.

Info.plist
<?xml version="1.0" encoding="utf-8" ?>
<plist version="1.0">
<dict>
<key>Shake</key>
<dict>
<key>APIClientID</key>
<string>your-api-client-id</string>
<key>APIClientSecret</key>
<string>your-api-client-secret</string>
</dict>
</dict>
</plist>

Initialize Shake SDK

AppDelegate.m
#import "AppDelegate.h"
@import Shake;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[SHKShake start];
return YES;
}
@end
AppDelegate.swift
import UIKit
import Shake
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Shake.start()
return true
}
}

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.