Giter Site home page Giter Site logo

bv-ios-sdk-conversations-example's Introduction

Conversations Example App

This simple demo app shows you the very basics for getting up and running with Conversations Reviews: Display and Submission. The app works out of the box simply by running the bv-ios-sdk-conversations-example.xcworkspace project in Xcode. However, if you want to display your own Conversations data, you will need your own API key and Client ID.

The demo project is written in Swift 3 on Xcode 8.3. However, know that the BVSDK is written in Objective-C so you can use the SDK with Swift 2.3+ and Objective-C code-bases.

The purpose of the demo is you make sure your full integration is working with Conversations Review types. Once you have the display and submission working for Review types, adding in other User Generated Content (Questions, Answers, Comments) is pretty much the same, just using different display and submission request objects.

Requirements

  • Conversations API Keys for your iOS application: one for production, one for staging environments.
  • Xcode 8+
  • A valid product ID in your product catalog.
  • Follow the Installation Instructions to generate your bvsdk_config_staging.json and bvsdk_config_prod.json files and add (or update) them to the bv-ios-sdk-conversations-example.xcworkspace project.

Optional Requirements

  • Login to the Production and Staging environments to the Bazaarvoice Portal (aka Workbench). This will help you find product IDs and test content submission.
  • Cocoapods. This demo checs in the /Pod folder with the BVSDK installed. You can run pod update at the repo root to make sure you have the latest BVSDK.

Tweaking the App

Once you have opended the demo app, here are the things you need to configure:

  1. AppDelegate.swift: Make sure you have set the environment to production or stagin in BVSDKManager.configure(<.staging | .prod>)
  2. Make sure the bvsdk_config_staging.json and bvsdk_config_prod.json are ready (depending on the environment in step 1.)
  3. Constants.swift: Set the TEST_PRODUCT_ID to a product ID in your catalog. This will be used for both display and submission of reviews.
  4. Launch the demo app!

When you launch the demo app you will see 2 buttons: Display Reviews and Submit Review.

Display Reviews

In ReviewsDisplayViewController.swift a Conversations Review display request is being made to display reviews. A single review is contained in a BVReview object. See MyReviewTableViewCell.swift for demo code on how to access the various attributes of a review object.

The demo simply prints out all the available types in a BVReviewsTableViewCell.

Submit Review

We recommend testing your integration against the staging environment in .submit action mode (rather than .preview) so that you can ensure your reviews are visible in the workbench.

In ReviewSubmitViewController.swift a call is being made to submit a review.

You may see some form errors if your request does not include all of the fields required per your configuration.

Once you go back and edit the BVReviewSubmission with the required parameters, you should now be able to submit successfully.

Common Errors

  • Submitting with BVSubmissionAction.Preview instead of BVSubmissionAction.Submit

You can think of BVSubmissionAction.Submit as a dry-run; the submission action will make a network call and validate the parameters, but the review itself will not be saved.

Futher Reading

bv-ios-sdk-conversations-example's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.