iOS SDK - Quick Start

CocoaPods Installation

Add the following to your Podfile:

pod 'ForeSee'

Visit the CocoaPods website for help getting started with Podfiles.

Manual Installation

If your project does not use CocoaPods, then you will need to manually install the SDK. You can download the latest version from the following page:

  1. Add ForeSee.framework to your project.
  2. Add the images in the assets folder to your project.
  3. Add the following frameworks/library to your project:
    • AVFoundation
    • CoreGraphics
    • CoreMedia
    • CoreMotion
    • CoreVideo
    • QuartzCore
    • SystemConfiguration
    • libz
  4. Add -ObjC to the OTHER_LDFLAGS setting of your project.

Configuration and Instrumentation

Perform these steps after installation:

  1. Follow these instructions to create your foresee_configuration.json file and add it to your project.
  2. Include the SDK using:
    #import <Foresee/Foresee.h>
  3. Start the SDK in your app delegate:
- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [ForeSee start];
    // This is an optional call. Normally, it is preferred to perform
    // the eligibility check when the app is launched. But there
    // are reasons to delay the check, e.g., the app has a login
    // screen and the check must wait until users have successfully
    // been authenticated.
    [ForeSee checkIfEligibleForSurvey];

- (void)applicationDidBecomeActive:(UIApplication *)application {
  // This checks eligibility when returning from a backgrounded state
  // This should not be present if an invitation is not to 
  // appear on app launch
  [ForeSee checkIfEligibleForSurvey];

Depending on how your foresee_configuration.json file is written, an invitation may not display right away. See the Debugging section for information on forcing the invite to display.


In Swift apps, add the following line to your bridging header:

#import <Foresee/Foresee.h>

Other articles in this section:

  1. SDK Overview
  2. Quick Start (current article)
  3. Configuration
  4. Trigger
  5. Replay
  6. Frequently Asked Questions
  7. Troubleshooting