Using Word of Mouth with the Tapstream iOS SDK

First, integrate the latest iOS SDK.

Integration instructions for iOS

Tapstream Word of Mouth gives you the ability to track and reward users for sharing your app with a friend.

Try creating a Word of Mouth campaign to get a feel for how Word of Mouth offers are designed and presented.

Word of Mouth requires iOS 6 or above, and the Tapstream SDK.

First, implement the latest Tapstream iOS SDK. Once you've done so, come back here and follow the instructions below.

If using CocoaPods, make sure that your Podfile includes a dependency on 'Tapstream/WordOfMouth' (The 'Tapstream' dependency will include this by default).


  • Copy the WordOfMouth folder from the SDK archive, and paste it into your project directory.
  • Open your Xcode project.
  • Drag the WordOfMouth folder from the your project directory and drop it into Xcode's Project Navigator. It should be placed as a child of the root project node.
  • Add #import "TSWordOfMouth.h" to your Objective-C bridging header file
  • In your project settings, add a framework reference to Social.framework

The following examples assume that the Tapstream SDK has been initialized in the usual manner before any Word of Mouth functionality is used.

About Word of Mouth

A Word of Mouth offer is a customizable modal that asks your user to share the app with another user in exchange for a reward, like this:

The configurable Word of Mouth offer modal

When the user clicks the call to action, Tapstream shows a share card that allows the user to share a unique link via iMessage/SMS, email, Facebook, or Twitter.

Tapstream tracks how many installs result from each link, and allows you to check if a user has earned a reward, defined by you, by referring their friends to your app.

All details of each offer are controlled from within the Tapstream dashboard - you don't need to define its style, images, messaging, or reward during integration.

Showing offers

Your app probably has several locations at which you might want to show an offer. These locations are called "insertion points". Each insertion point should be uniquely identified with a string name that you entered in your Tapstream dashboard. At each insertion point in your code, you'll need to ask the SDK for eligible offers.

Here's how to query and display an offer at an insertion point called "launch":

let wom = TSTapstream.wordOfMouthController() as! TSWordOfMouthController

wom.getOfferForInsertionPoint("launch") { (resp: TSOfferApiResponse?) in
    if(resp == nil || resp!.failed()){
        // Handle Failure
    if let offer = resp!.offer {
        wom.showOffer(offer, parentViewController:self);


  • The -offerForInsertionPoint:result: method will not always return an offer. The rules that decide whether an offer is eligible to be shown at a particular insertion point, at a particular time, are managed in your Tapstream dashboard.

  • The -showOffer:parentViewController: method adds a subview to the current view, and needs a pointer to the current UIViewController in order to do so. In this example, the containing object inherits from UIViewController and so self is passed as the parent view controller.

If your use case allows, it is safe to pre-load the offer for later display, as in this example:

class MyViewController: UIViewController {
    var wom: TSWordOfMouthController!
    var offer: TSOffer!

    override func viewDidLoad() {

        self.wom = TSTapstream.wordOfMouthController() as! TSWordOfMouthController

        self.wom.getOfferForInsertionPoint("launch") { (resp: TSOfferApiResponse?) in
            if let offer = resp?.offer {
                self.offer = offer

    func showWoMInterstital() {
        if(self.offer != nil) {
  , parentViewController: self)

Checking for rewards

When one of your users accepts an offer and successfully refers friends to your app, they may become eligible to receive a reward. Rewards are defined in your Tapstream dashboard.

At least once per session (but ideally, periodically over the course of a user session), your code should check for available rewards. If there are available rewards, your code should deliver the reward to the user and then tell the SDK that the reward has been consumed so that it will not be delivered again.

Here's how you might check for and consume available rewards:

wom.getRewardList { (response: TSRewardApiResponse?) in
    if response == nil || response!.failed() {
        self.logMessage("Reward Request failed!")
    for reward in response!.rewards {
        // Rewards present in response.rewards are those that are due for
        // delivery. After a reward is delivered, consume it so that it won't
        // be delivered twice.