Example Projects
This page provides example projects to get you up-and-running quickly with the Bazaarvoice Mobile SDK for iOS.
Introduction
The Bazaarvoice SDK for iOS comes with example projects in both Swift and Objective-C GitHub repos. The examples are written in such a way that you can easily drop in your own configurations files and quickly get familiar with the APIs and data.
Objective-C
There is a full kitchen-sink style BVSDKDemo app for Objective-C that contains all the SDK functionality in a mock eCommerce mobile app. The BVSDKDemo app runs out-of-the-box with mock data so you can run it to get an idea of how Bazaarvoice solutions might fit into your mobile solution. Run your own data in the Example Apps Any of the example apps can be configured to display your own data. To do this you will need to visit the Installation and Configuration page to create and download your configuration files. Once you've entered a valid configuration you will be given the option to download your configuration files. This will download bvsdk_config_prod.json and/or bvsdk_config_staging .json depending on API keys entered. These files will need to be added to the example app target.
Swift
There is a BVSwiftDemo with three schemes available:
- BVSwiftDemo (the default scheme for Production)
- Staging
- Mock
To use the BVSwiftDemo or Staging schemes, add your required keys in ConfigurationManager.swift
class and Mock schemes (using OHHTTPSStubs
) will display sample data.
The Swift and BVSDKDemo examples require XCode 8.0+ or greater. All Swift examples are written and tested against the Swift 3.0 compiler.
Basic example projects
Product Recommendations, and Conversations all come with example projects, which demonstrate how to properly implement these modules. Each of the BVSDK modules below are located under the BV iOS SDK Examples directory and have both Swift and Objective-C reference implementations. The BVSwift example project is located under the BV iOS Swift SDK Examples directory and has Swift reference implementation.
- Conversations: Demonstrates a minimal configuration for constructing a Conversations API request for display or content submission.
- Product Recommendations: Shows how you can fetch and display product recommendations for a user.
Running examples
The example project require the use of Cocoapods to set up the XCode workspace before you can run any of the samples.
Full SDK integration examples
The full BVSDK and BVSwift projects work out-of-the box under the /Examples
folder. Just run pod install
in that folder and open the .xcworkspace
file to execute the project. By default the BVSDKDemo app runs in mock mode (using OHHTTPSStubs) and by default the BVSwift app runs in production mode. In Mock mode the app will display sample data from a ficticious project catalog for a ficticious company, Endurance Cycles. The demonstration shows the major components of the SDK from Product Recommendations, and Custom Photo Upload. The Conversations examples demonstrate how to read Conversation statistics, fetch reviews and questions, and how to construct forms for uploading UGC content such as Rating & Reviews, Questions, and Feedback.
Updated 10 months ago