Demo App

Using the VWO demo app, you can try Mobile App A/B testing.
To try the demo app, you will need ApiKey.

Running the Demo App

Clone the demo app from https://github.com/wingify/vwo-ios-sdk
Browse to vwo-ios-sdk/Demo
Run pod install

Enter ApiKey

You need to add an app to your VWO account. Please refer to Adding an App for details.
Copy your ApiKey.
Run the app from Xcode. You can choose either a simulator or your iPhone.

When the app is running, click the Menu icon in the upper-left corner.

750

Select Enter API Key from the menu options, and then paste your api key.
If you using a simulator, you can use Command ⌘ + Shift ⇧ + V to paste your api key in the text box.

Xcode launch parameters

Developers can use Xcode launch parameters to test the app.
Step to launch:

  1. Open Edit Scheme (Command ⌘ + Shift ⇧ + <)
  2. Run → Arguments → Arguments Passed on Launch
  3. Click on + sign and add your API in format -VWOApiKey <your-api-key>
  4. Close
1794

When you run your app after setting launch argument, it should appear pre filled in launch alert

750

🚧

APIKey in launch will not launch VWO

Adding your API Key to the launch parameter will only make your work easy by automatically adding the API key to the input text field. Developer will have to manually launch the app separately.

Sorting Campaign

Showing a list of items is a common requirement for many apps.
How do you know what sequence is better? What better way to tell than to A/B test!

Defining Variation

Steps to run Sorting Campaign:

  1. Under Mobile App A/B, click Create Menu and then choose your App, platform and set test key to "sorting". Click Next for Variations screen.
  2. On the Variations screen, update the variation names as seen in the image below
1368

In your app, click the Refresh icon located in the upper-right corner of the navigation bar.
This should change the sequence of items

750

Following code handles the A/B testing for Sorting campaign

let variation = VWO.variationNameFor(testKey: "sorting")
switch variation {
case "Sort-Alphabetically":
    phoneList.sort(by: sortPhoneAlphabetically)
case "Sort-By-Price":
    phoneList.sort(by: sortPhoneByPrice)
default:
    print("Default")
    break
}
tableView.reloadData()

The code above does following things

  1. Get the variation name for campaign whose test key is "sorting"
  2. Depending on the variation name we decide if the sorting is to be done alphabetically or by price
  3. Once the list is sorted we reload the table data

Defining Goals

Click Next, and then define a goal using the following goal identifier.

We can see if the goals work correctly.
Click Verify.

1372

Select your device from the drop-down menu.

1206

On selecting any product (phone) from the list, you can see the product details.

750

When you select the product, Goal 1 becomes Verified.

1208

This happens because, we have placed VWO.trackConversion( "productView") code upon selecting a product.

If you want to verify the goal for variation, select Variation from the drop-down menu, select refresh in the app, and then repeat the same process.

Finalize Campaign

Click Next to move to the final stage of campaign creation. You can set percentage traffic allocation and then do advance targeting.

To start the campaign, click Finish.

Variable Campaign

How do you know what content would appeal to your users
This campaign helps us test various alerts by presenting various titles and content

Defining Variation

Steps to run Layout Campaign:

  1. Under Mobile App A/B, click Create and then choose your mobile app.
  2. In the Variations screen, create variable named heading and content of String type
  3. Set the values accordingly
  4. You can use the code generated on right side
1812

After creating the variables add them to your campaign and set values accordingly

1364

Select your device from the options(three dots), and then select Preview on Device.

1208

In your app, click on any house in the list and you can verify the look and feel of all the variation
The variation section of the demo app will change.

750

Defining Goals

Click Next and then define a goal using the following goal identifier.

We can see if goals work correctly.
Click Verify.

1352

From the device drop-down menu, select your device.

1206

When you tap on upgrade button in the alert, the goal will get verified

1204

This happens because , we have placed VWO.markConversionFor(goal: "upgrade-clicked") code on tapping the upgrade button.

If you want to verify the goal for the variation, select Variation from the Control drop-down menu and then tap on Upgrade button in alert

Finalize Campaign

To move to the final stage of campaign creation, click Next. Now, you can set percentage traffic allocation and perform advance targeting.

To start the campaign, click Finish.