Skip to main content
Version: 3.x

Upgrading to 3.x from 2.x

What changed

  • The addition of banner interstitials (and Quick Questions).
  • The ability to send user attributes in a hash map which can be used to target specific content to specific users.
  • The addition of new error handling callbacks with more specific error codes.
  • Core SDK logic moved into JS which allows us to push bug fixes and feature updates without you having to update the SDK.
  • Management of placement statement has been moved into our SDK so your app doesn't have to manage it. Now, once the SDK is initialized, you can just ask the SDK if you can show content for a tag, we return a true/false, and then you show the content for that placement.

Before you begin

  • Reach out to developers@tapresearch.com and have them enable your account for 3.x.x SDKs.
  • Once your account is enabled, you will need to create a new app that is enabled for 3.x.x SDKs. This will involve recreating currencies and placements.
  • Once your new app is created, you will need to update your app to use the new app's API token and placement tags
  • 3x is not backwards compatible so there will need to be code changes to make it work properly - these are outlined in the sections below.
  • An active piece of content will need to be added to one of the placements you created in order to return true in showcontentforplacement and canshowcontentforplacement (read instructions below to understand these new methods).
  • When you are ready to test, make sure you set up your test devices on the publisher dashboard:
  • Especially if you are using our new Quick Questions feature, you’ll want to initialize the SDK as early as possible. Not sure what Quick Questions is and want to find out more? Reach out to developers@tapresearch.com or take a look at our Quick Questions section in this doc.
  • You may want to have placements for survey walls, banners, interstitials, and Quick Questions located at various places in your app. Be sure to set up the placement calls early and often where you think you may want to show these features. This way you don’t have to go back into the code later to add them.

More questions as you’re getting started? Don’t hesitate to reach out!

Steps

Update dependencies

Update your TapResearch dependency to 3.2.1 or higher following the instructions for your platform below

Update initialization

Update your initialization code to now include both the API token and the user identifier of the currently logged in user.

  • If the currently logged in user is not available at initialization time, use a random string (if available)
  • Replace the logged in user's identifier when available by calling the TapResearchSDK.setUserIdentifier(userId) method

Update callbacks

Update your reward callback to now accept an array of TRReward objects instead of a single TRReward object

  • TRReward object the rewardAmount and currencyName as available methods
  • There is additional information available in the TRReward object

Create a global error callback to handle errors

  • TRError (Android) or NSError (iOS) include code (iOS & Android) and localizedDescription (iOS) description (Android) as available properties

Update how you call placements

The showPlacement method has been updated to showContentForPlacement or showContent(forPlacement:) depending on your platform

Notes for updating from 3.0.x-beta* to 3.2+

To match the naming convention of our other SDKs, we have renamed some of the callbacks on android

  • Renamed didReceiveReward to onTapResearchDidReceiveRewards
  • Renamed onError to onTapResearchDidError
  • Renamed onContentDismissed to onTapResearchContentDismissed
  • Renamed onContentShown to onTapResearchContentShown