Skip to content
Jason Harris edited this page Apr 21, 2016 · 10 revisions

Overview

The BVSDK is comprised of a core SDK (BVCore) and 4 optional SDK modules that can be installed.

  • Product Recommendations ("BVRecommendations") - Provides access to Bazaarvoice product recommendations. It also provides three easy-to-use views to set up product recommendations with low effort.
  • Targeted Advertising ("BVAdvertising") - Provides access to highly targeted advertising, used in conjunction with Google Mobile Ads.
  • Conversations ("BVConversations") - Provides access to Bazaarvoice's Conversations platform, to consume and contribute ratings & reviews, questions & answers, photos, videos, user stories, etc.

Installation

  1. Install the SDK with CocoaPods (recommended)

    1. Alternatively, you can install the SDK manually.
  2. Add the required import statements

Cocoa Pods Installation

The simplest way to add the BVSDK to your project is through CocoaPods. If you do not have CocoaPods installed you can follow the Cocoapods Installation Instructions.

Edit your Podfile

A complete Podfile that installs all the BVSDK modules is shown below. Only include the pod statements that you need.

# Add use_frameworks! ONLY if you are building with Swift and are NOT using an Objective-C bridging header. Then uncomment the following line:
#use_frameworks!

target 'YOUR_TARGET_NAME' do
   # Default install: Installs BVConversations and core modules.
   pod "BVSDK/BVConversations"
   # Installs BVAdvertising and core modules.
   pod "BVSDK/BVAdvertising"
   # Installs BVRecommendations Shopper Advertising API and core modules.
   pod "BVSDK/BVRecommendations"
    # Installs BVCurations and core modules.
   pod "BVSDK/BVCurations"
end

When you have configured your Podfile, simply run pod install from your project directory to install the BVSDK modules.

Great! The SDK is included in your project. You can now add the required imports to your Objective-C or Swift project.


Manual Installation

Please note that manual installation is not recommended, due to difficulty of dependencies and upgrading SDK versions.
However, if needed, you can install the SDK by cloning or downloding this library and adding the source files to your project:

  1. Clone this repo, or download it with the "download zip" button:
    Download from master
  2. Highlight the source folders you want to add, under /Pod/

and drag them into your Xcode project:

  1. Select 'Copy Items if Neeeded', and continue:

  1. Install 3rd-Party Dependencies

BVSDK uses a couple external libraries, that need to be installed alongside BVSDK. This step is only required for BVAdvertising and/or BVRecommendationsUI modules. * BVAdvertising -- Requires installation of the Google Ads SDK Framework. Please refer to the manual installation instructions on the Google Developers site.

  1. Great! The SDK is included in your project. You can now add the required imports to your Objective-C or Swift project.

Add Required Imports

The imports for header files will differ depending on whether your project is Objective-C or Swift+Objective-C bridging header, or a Swift project using dynamic frameworks. The samples below provide you a sample of the fully installed BVSDK. However, you only need to include the headers that map to the modules you installed. If you are using an Objective-C briding hearder in your Swift project please refer to Apple's documentation on the process.

Objective-C or Objective-C-Bridging-Header

// Import BVSDK.h for all modules, including BVConversations
#import "BVSDK.h"
// Import BVAdvertising.h when using BVAdvertising
#import "BVAdvertising.h"
// Import BVConversations.h when using BVConversations
#import "BVConversations.h"
// Import BVRecommendations.h when using BVRecommendations
#import "BVRecommendations.h"
// Import BVCurations.h when using BVCurations
#import "BVCurations.h" 

Swift project using dynamic frameworks

Note: this is not necessary for Swift project that include the SDK via the Objective-C Bridging Header.

For Swift compilation, you will need to add only one import to each .swift file that references the BVSDK:

import BVSDK