Skip to content
Tim Kelly edited this page Dec 18, 2015 · 10 revisions

Overview

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

  • Product Recommendations (BVRecommendations) and Recommendations UI (BVRecommendationsUI) - 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, powered by 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.

The BVSDK modular-architecture is presented below:

Installation

Follow these steps for installing the BVSDK:

Choose an install method

  1. CocoaPods (recommended)

or

  1. Manual Install.

Add the imports

Finally, configure your imports

Cocoa Pods Installation

WARNING: Developers with Swift projects and the BVAdvertising module MUST install manually. The Google Mobile Ads SDK does not currently support being installed as a submodule with Cocoapods when use_frameworks! is in your Podfile. For this use case, please follow the manual installation steps for Swift when using BVAdvertising.

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.

Initialize Cocoapods

Cocoapods requires the use of an XCode .xcworkspace to build the Pod dependencies. For initial setup of creating the Podfile and .xcworkspace simply run $ pod init from a Terminal at the location of your .xcproject file. You only need to do this once.

Edit Podfile Contents

A complete Podfile that installs all the BVSDK modules for a project named ExampleProject would look like the example below. Only include the pod statements that you need. Lines beginning with # are ruby comments to help guide you which pod dependencies 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 'ExampleProject' do
   # Default install: Installs BVConversations and core modules.
   pod "BVSDK"
   # # 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 BVRecommendations and BVRecommendationsUI plus core modules.
   pod "BVSDK/BVRecommendationsUI"
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

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.

* **BVRecommendationsUI** -- Requires installation of [SDWebImage](https://github.com/rs/SDWebImage), [HCSStarRatingView](https://github.com/hsousa/HCSStarRatingView) and [SVProgressHUD](https://github.com/TransitApp/SVProgressHUD) open source add-ins from github.
  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.

Imports for Objective-C or Objective-C Bridging Header

// Import BVSDK.h for all modules, including BVConversations
#import <BVSDK/BVSDK.h>
// Import BVAdvertising.h when using BVAdvertising
#import <BVSDK/BVAdvertising.h>
// Import BVRecommendations.h when using BVRecommendations
#import <BVSDK/BVRecommendations.h>
// Import BVRecommendationsUI.h when using BVRecommendationsUI
#import <BVSDK/BVRecommendationsUI.h>

Imports for Swift project using dynamic frameworks

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

import BVSDK

A note on Swift and Dynamic Frameworks

Google's Mobile Advertising SDK does not support the use of dynamic frameworks. If you try to install the Google Mobild Ads SDK via your Podfile and use use_frameworks! in your Podfile, you will not be able to link. This is because Swift does not support static frameworks.

You can workaround this issue by downloading and installing the Google Mobile SDK manually.