developer

Get Started

Install

YahooSearchKit is a framework that you can add to your Xcode project. You can download the framework as a ZIP file or using Cocoapods.

Install from Zip

  1. Download YahooSearchKit.
  2. Unzip the YahooSearchKit ZIP file.
  3. Open a Finder window and navigate to your download location.
  4. Open the “Framework” folder and drag YahooSearchKit.framework into the “Link Binary With Libraries” section for your application target in Xcode.
  5. Open the “Resources” folder under YahooSearchKit.framework and drag YahooSearchKitResources.bundle into the “Copy Bundle Resources” section for your application target.
  1. Add CoreLocation.framework, CoreTelephony.framework and WebKit.framework under “Link Binary With Libraries” section for your application target
  2. Lastly, add -ObjC and -all_load to “Other Linker Flags” under “Build Settings” for your application target

Tip

See a video walkthrough for installing from zip.

Install using Cocoapods

Cocoapods is a popular tool that developers use to download and install third-party libraries during app development.

If you don’t have Cocoapods, you can install it from: http://cocoapods.org/

  1. After installing Cocoapods, add the following lines to your Podfile:
pod 'YahooSearchKit'
  1. Run ‘pod install’.

Tip

See a video walkthrough for installation using Cocoapods.

Initialize

You must initialize YahooSearchKit with your application ID by calling -[YSLSetting setupWithAppId:] as shown below.

To get your application ID, follow the onboarding steps on the Yahoo Developer Network.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [YSLSetting setupWithAppId:@"your application id"];
    return YES;
}

Note

Attempting to use YahooSearchKit without properly initializing first will throw an exception.

If you provide an invalid Application ID during initialization, YahooSearchKit will display an ‘Invalid Application ID’ error alert.

Next, follow the integration steps for In-App or Search-to-Link to add search features.

Integrating with Swift

You can use YahooSearchKit in your Swift-based applications. Follow these additional steps to integrate with a Swift-based application.

  1. Create a new header file in your project and name it XXX-Bridging-Header.h` (e.g ``MyApp-Bridging-Header.h).
  2. Add the following import statement to the bridging header file:
#import <YahooSearchKit/YahooSearchKit.h>

3. Set the full path to the above header file in “Objective-C Bridging Header” under “Build Settings” for your application target such as $(PROJECT_DIR)/MyApp/MyApp-Bridging-Header.h).

Tip

See a video walkthrough for integrating with Swift.

Developer Mode

YahooSearchKit supports a developerMode flag. This flag turns off ad tracking and attribution while you are still developing your app.

It is set to YES by default. You must set it to NO for the final build that you will submit to Apple. Otherwise, any searches performed or ads clicked on using your application will not receive attribution.

[YSLSetting sharedSetting].developerMode = NO;