ForeSee Developer Portal

Everything you need to set up and optimize your ForeSee product. Home of developer documentation, implementation guides, and question/answer forums.

Blueprint

Getting Started

CocoaPods Installation

  1. Add the following to your Podfile:
platform :ios, '9.0'  
pod 'ForeSee'

Information about the latest ForeSee SDK CocoaPod can be found here: https://cocoapods.org/pods/ForeSee.

Visit the CocoaPods website for help getting started with Podfiles.

Alpha Releases

The CocoaPods website always shows the latest version of a pod, even if it's a pre-release version (e.g. 5.0.1-alpha1). CocoaPods is smart enough to properly handle pre-release pods in the Podfile, but their website makes no distinction between pre-release and production-ready versions. Pre-release pods are not suitable for App Store releases.

Configuration and Instrumentation

  1. After installation, follow these instructions to create your foresee_configuration.json file and add it to your project.
  2. Follow the implementation instructions for either Objective-C or Swift.

Objective-C

In Objective-C apps:

  1. Include the SDK using:
#import <ForeSee/ForeSee.h>
  1. Start the SDK in your app delegate:
- (BOOL) application:(UIApplication *)application 
        didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [ForeSee start];
}
  1. Check for eligibility in a place where the invitation should be shown. This example shows how to check for eligibility every time the app is launched:
- (void) applicationDidBecomeActive:(UIApplication *)application {
  [ForeSee checkIfEligibleForSurvey];
}

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

Swift

In Swift apps:

  1. Add the following lines to your bridging header:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <ForeSee/ForeSee.h>
  1. Start the SDK in your AppDelegate:
func application(_ application: UIApplication, 
        didFinishLaunchingWithOptions 
        launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    ForeSee.start()
    return true
}
  1. Check for eligibility in a place where the invitation should be shown. This example shows how to check for eligibility every time the app is launched:
func applicationDidBecomeActive(_ notification: NSNotification) {
    ForeSee.checkIfEligibleForSurvey()
}

Uploading to the App Store

The object file in ForeSee.framework contains architectures for both simulators and real devices. App Store submissions must not contain simulator architectures. More information is available here:

https://developer.foresee.com/v1.0/docs/common-problems-2#section-errors-uploading-to-the-app-store

Manual Installation

If your project does not use CocoaPods, you must install the SDK manually. You can download the latest version from the following page: ForeSee iOS SDK Release Notes

In most cases, when using the latest versions of Xcode and the ForeSee iOS SDK, you simply need to add the framework to your project:

  1. Copy the ForeSee.framework file into your project.

  2. Include ForeSee.framework as an embedded binary (Your Target -> General -> Embedded Binaries).

  3. Proceed to "Configuration and Instrumentation".

Additional steps for older versions of the SDK

Some older versions of the SDK (pre-framework) require additional setup steps.

The following steps are usually not required. These steps are presented for older versions of the ForeSee SDK (before 5.0.0).

  1. Add the images in the assets folder to your project. Please make sure to add the images as individual (or group of) files and not via the folder the images are in, as this causes problems in some cases.

  2. Add the following frameworks to your project (Build Phases -> Link Binary With Libraries):

    • AVFoundation
    • CoreGraphics
    • CoreMedia
    • CoreMotion
    • CoreVideo
    • QuartzCore
    • SystemConfiguration
    • libz
    • UserNotifications
    • Foundation
  3. Add -ObjC to the OTHER_LDFLAGS setting of your project.

  4. Proceed to "Configuration and Instrumentation".

Getting Started