Hello 👋 How can we help?

Adding SDK to your project

Written by Konstantine
Updated 1 month ago


1. Install sdk via CocoaPods
2. Add the following import to the top of the AppDelegate.m:

ObjC:
#import <HelpCrunchSDK/HelpCrunch.h>
Swift:
import HelpCrunchSDK

3. Initialize the Helpcrunch SDK in HelpCrunchSDK/HelpCrunch.h file:

ObjC:
[HelpCrunch initForOrganization:@"YOUR_HELPCRUNCH_SUBDOMAIN" withAttributes:@{
  HC_ApplicationIdAttributeName:@"YOUR_APP_ID",
  HC_ApplicationSecretAttributeName:@"YOUR_APP_SECRET"
} completionHandler:^(BOOL succeeded, NSError *error) {}];
Swift:
HelpCrunch.initForOrganization("YOUR_HELPCRUNCH_SUBDOMAIN",
 withAttributes:[
  HC_ApplicationIdAttributeName:"YOUR_APP_ID",
  HC_ApplicationSecretAttributeName:"YOUR_APP_SECRET"
]) { (succeeded, error) in  }

You can copy this code on apps list in your HelpCrunch account

4. By default HelpCrunch SDK is initialized on the app startup, so that you can always get the latest data about your users. We also recommend to implement the method [HelpCrunch restoreFromBackground];/ HelpCrunch.restoreFromBackground() in application WillEnterForeground to initialize the HelpCrunch SDK when the app is restored from background.

5. To show the HelpCrunch UI simply call the showFromController helper method on HelpCrunch:

ObjC:
[HelpCrunch showFromController:viewController];
Swift:
HelpCrunch.show(from: viewController)
viewController – required – the controller to be presented from.

7. After you have called the showFromController method it will look like this:

Did this answer your question?