Skip to main content
Version: 3.x

Upgrading to 3.x from 2.x

What changed​

  • Banner interstitials and Quick Questions - New content formats to engage users
  • User attributes - Send attributes in a hash map to target specific content to specific users
  • Enhanced error handling - New callbacks with more specific error codes
  • Core SDK logic in JavaScript - Enables us to push bug fixes and feature updates without requiring SDK updates
  • Simplified placement management - The SDK now manages placement state. Simply ask if content can be shown for a tag, receive a true/false response, and display the content accordingly

Before you begin​

Account setup​

  1. Enable your account - Contact developers@tapresearch.com to enable your account for 3.x.x SDKs
  2. Create a new app - Once enabled, create a new 3.x.x-enabled app (you'll need to recreate currencies and placements)
  3. Update credentials - Update your app to use the new app's API token and placement tags

Important considerations​

  • ⚠️ Breaking changes: Version 3.x is not backwards compatible. Code changes are required (outlined below)
  • Content requirement: Add at least one active piece of content to your placements for canShowContentForPlacement to return true and for showContentForPlacement to show anything
  • Early initialization: Initialize the SDK as early as possible once the user identifier is known. Do NOT use anonymous user identifiers, especially when using Quick Questions
  • Placement strategy: Set up placement calls early and throughout your app for survey walls, banners, interstitials, and Quick Questions. This prevents having to add them later

Testing setup​

Add your test devices in the Publisher Dashboard under More → Test devices, using either the device identifier or the user identifier you initialize the SDK with:

See Testing for more.

Learn more​

Not sure what Quick Questions is? Contact developers@tapresearch.com or see Quick Questions.

Questions? Don't hesitate to reach out to developers@tapresearch.com!

Steps​

Update dependencies​

Update your TapResearch dependency to 3.x following the instructions for your platform:

Update initialization​

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

Update callbacks​

Reward Callback:

  • Update to accept an array of TRReward objects instead of a single object
  • TRReward provides rewardAmount and currencyName properties
  • See additional TRReward information

Error Callback:

  • Create a global error callback to handle errors
  • Android: TRError includes code and description properties
  • iOS: NSError includes code and localizedDescription properties

Update how you call placements​

The showPlacement method has been renamed:

  • Most platforms: showContentForPlacement
  • iOS (Swift): showContent(forPlacement:)