Installing User Hook For iOS

Installing the User Hook SDK into your iOS app is simple and quick. Once you follow the steps below you, your app will be connected to the User Hook platform.

Setup Application

Before integrating User Hook into your iOS application, be sure you have logged into the User Hook Admin page and created your account. You will need to know your App Id and App Key while installing the iOS SDK.

Download SDK

The easiest way to install the iOS SDK is through CocoaPods. You will need to add User Hook to your Podfile and then run pod install.

platform :ios, '8.0'
pod 'UserHook'

If you would like to view the code or need to manually install the SDK, you can download the project files from Github.

Initialize User Hook

Initializing User Hook is as simple as adding two lines of code.

First you will need to add an import statement:

 #import <UserHook/UserHook.h>

And then you will need to initialize the SDK inside the application:didFinishLaunchingWithOptions method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Override point for customization after application launch.

    // setup User Hook
    [UserHook setApplicationId:@"YOUR_USERHOOK_APP_ID" apiKey:@"YOUR_USERHOOK_APP_KEY"]
}

Feedback Attachments

If your account allows image attachments to be uploaded with user feedback, you will need to add the proper privacy permission to your app plist file. iOS 10 and above require apps to request special permissions for apps to access a user’s photo library. Without this permission, a user will not be able to select an image file to upload.

The source version of this entry looks like:

<plist version="1.0">
<dict>
...

 <key>NSPhotoLibraryUsageDescription</key>
 <string>This app needs to access your photos</string>

...
</dict>
</plist>

Done

That’s it. User Hook is now setup and will begin tracking user sessions.

If you would like to further customize the SDK, please reference the advanced configuration instructions. This is optional and only needed if you wish to style User Hook to fit the visual style of your app.