Tapjoy SDK - C++ API
tapjoy::Tapjoy Class Reference

C++ API class of the Tapjoy SDK. More...

#include <TapjoyCpp.h>

Static Public Member Functions

static const char * getLibraryName ()
 Returns the name of the library linked.
 
static const char * getVersion ()
 Returns the version name of the SDK. More...
 
static void setDebugEnabled (bool enable)
 Enables the debug mode of the SDK. More...
 
static bool connect (const char *sdkKey, TJConnectListener *listener=NULL)
 Connects to the Tapjoy Server. More...
 
static void getCurrencyBalance (TJGetCurrencyBalanceListener *listener)
 Gets the virtual currency data from the server for this device. More...
 
static void spendCurrency (int amount, TJSpendCurrencyListener *listener)
 Spends virtual currency. More...
 
static void awardCurrency (int amount, TJAwardCurrencyListener *listener)
 Awards virtual currency. More...
 
static void setEarnedCurrencyListener (TJEarnedCurrencyListener *listener)
 Sets the listener which gets informed whenever virtual currency is earned. More...
 
static void setCurrencyMultiplier (float multiplier)
 ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY. More...
 
static float getCurrencyMultiplier ()
 Gets the multiplier for the virtual currency display. More...
 
static void trackPurchase (const char *productId, const char *currencyCode, double price, const char *campaignId)
 Tracks a purchase. More...
 
static void trackEvent (const char *name)
 Tracks an event of the given name without category.
 
static void trackEvent (const char *name, int64_t value)
 Tracks an event of the given name without category, with a value. More...
 
static void trackEvent (const char *category, const char *name, int64_t value)
 Tracks an event of the given category and name, with a value.
 
static void trackEvent (const char *category, const char *name, const char *parameter1, const char *parameter2)
 Tracks an event of the given category and name, with two parameters.
 
static void trackEvent (const char *category, const char *name, const char *parameter1, const char *parameter2, int64_t value)
 Tracks an event of the given category and name, with two parameters and a value.
 
static void trackEvent (const char *category, const char *name, const char *parameter1, const char *parameter2, const char *valueName, int64_t value)
 Tracks an event of the given category and name, with two parameters and a named values.
 
static void trackEvent (const char *category, const char *name, const char *parameter1, const char *parameter2, const char *value1Name, int64_t value1, const char *value2Name, int64_t value2)
 Tracks an event of the given category and name, with two parameters and two named values.
 
static void trackEvent (const char *category, const char *name, const char *parameter1, const char *parameter2, const char *value1Name, int64_t value1, const char *value2Name, int64_t value2, const char *value3Name, int64_t value3)
 
static void startSession ()
 Manual session tracking. More...
 
static void endSession ()
 Manual session tracking. More...
 
static void setUserID (const char *userID)
 Assigns a user ID for this user/device. More...
 
static void setUserLevel (int userLevel)
 Sets the level of the user. More...
 
static void setUserFriendCount (int friendCount)
 Sets the friends count of the user. More...
 
static void setAppDataVersion (const char *dataVersion)
 Sets the data version of the App or Game. More...
 
static void setUserCohortVariable (int variableIndex, const char *value)
 Sets a variable of user for the cohort analysis. More...
 
static void clearUserTags ()
 Removes all tags from the user.
 
static void addUserTag (const char *tag)
 Adds the given tag to the user if it is not already present. More...
 
static void removeUserTag (const char *tag)
 Removes the given tag from the user if it is present. More...
 
static void setVideoListener (TJVideoListener *listener)
 Sets the video listener. More...
 
static void actionComplete (const char *actionID)
 Informs the Tapjoy server that the specified Pay-Per-Action was completed. More...
 
static void subjectToGDPR (bool gdprApplicable)
 This can be used by the integrating App to indicate if the user falls in any of the GDPR applicable countries (European Economic Area). More...
 
static void setUserConsent (const char *value)
 This is used for sending User's consent to behavioral advertising such as in the context of GDPR The consent value can be "0" (User has not provided consent), "1" (User has provided consent) or a daisybit string as suggested in IAB's Transparency and Consent Framework. More...
 
static void belowConsentAge (bool isBelowConsentAge)
 In the US, the Children’s Online Privacy Protection Act (COPPA) imposes certain requirements on operators of online services that (a) have actual knowledge that the connected user is a child under 13 years of age, or (b) operate services (including apps) that are directed to children under 13. More...
 
static bool isConnected ()
 Helper function to check if SDK is initialized.
 

Detailed Description

C++ API class of the Tapjoy SDK.

Member Function Documentation

◆ actionComplete()

static void tapjoy::Tapjoy::actionComplete ( const char *  actionID)
static

Informs the Tapjoy server that the specified Pay-Per-Action was completed.

Should be called whenever a user completes an in-game action.

Parameters
actionIDThe action ID of the completed action.

◆ addUserTag()

static void tapjoy::Tapjoy::addUserTag ( const char *  tag)
static

Adds the given tag to the user if it is not already present.

Parameters
tagthe tag to be added

◆ awardCurrency()

static void tapjoy::Tapjoy::awardCurrency ( int  amount,
TJAwardCurrencyListener listener 
)
static

Awards virtual currency.

This can only be used for currency managed by Tapjoy. The data will be returned in a callback to onAwardCurrencyResponse() to the class implementing the listener.

Parameters
listenerthe class implementing the TJAwardCurrencyListener callback

◆ belowConsentAge()

static void tapjoy::Tapjoy::belowConsentAge ( bool  isBelowConsentAge)
static

In the US, the Children’s Online Privacy Protection Act (COPPA) imposes certain requirements on operators of online services that (a) have actual knowledge that the connected user is a child under 13 years of age, or (b) operate services (including apps) that are directed to children under 13.

Deprecated:
Deprecated since version 12.6.0
   Similarly, the GDPR imposes certain requirements in connection with data subjects who are below the applicable local minimum age for online consent (ranging from 13 to 16,
   as established by each member state).

   For applications that are not directed towards children under 13 years of age, but still have a minority share of users known to be under the applicable minimum age,
   utilize this method to access Tapjoy’s monetization capability. This method will set ad_tracking_enabled to false for Tapjoy which only shows the user contextual ads. No ad tracking will be done on this user.
Parameters
isBelowConsentAgeTrue if below consent age (COPPA) applies to this user, false otherwise

◆ connect()

static bool tapjoy::Tapjoy::connect ( const char *  sdkKey,
TJConnectListener listener = NULL 
)
static

Connects to the Tapjoy Server.

Parameters
sdkKeyYour Tapjoy SDK Key.
listenerlistener for connect success/failure

◆ endSession()

static void tapjoy::Tapjoy::endSession ( )
static

Manual session tracking.

Notifies the SDK that the session of your application has been ended.

◆ getCurrencyBalance()

static void tapjoy::Tapjoy::getCurrencyBalance ( TJGetCurrencyBalanceListener listener)
static

Gets the virtual currency data from the server for this device.

The data will be returned in a callback to onCurrencyBalanceResponse() to the class implementing the listener.

Parameters
listenerthe class implementing the TapjoyCurrencyBalanceListener callback

◆ getCurrencyMultiplier()

static float tapjoy::Tapjoy::getCurrencyMultiplier ( )
static

Gets the multiplier for the virtual currency display.

Deprecated:
Deprecated since version 11.4.0
Returns
Currency multiplier.

◆ getVersion()

static const char* tapjoy::Tapjoy::getVersion ( )
static

Returns the version name of the SDK.

Returns
a string which represents the version name

◆ removeUserTag()

static void tapjoy::Tapjoy::removeUserTag ( const char *  tag)
static

Removes the given tag from the user if it is present.

Parameters
tagthe tag to be removed

◆ setAppDataVersion()

static void tapjoy::Tapjoy::setAppDataVersion ( const char *  dataVersion)
static

Sets the data version of the App or Game.

Parameters
dataVersionthe data version

◆ setCurrencyMultiplier()

static void tapjoy::Tapjoy::setCurrencyMultiplier ( float  multiplier)
static

ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY.

Deprecated:
Deprecated since version 11.4.0


Sets the multiplier for the virtual currency displayed in placements.
The default is 1.0

Parameters
multiplier

◆ setDebugEnabled()

static void tapjoy::Tapjoy::setDebugEnabled ( bool  enable)
static

Enables the debug mode of the SDK.

Parameters
enabletrue to enable

◆ setEarnedCurrencyListener()

static void tapjoy::Tapjoy::setEarnedCurrencyListener ( TJEarnedCurrencyListener listener)
static

Sets the listener which gets informed whenever virtual currency is earned.

Parameters
listenerclass implementing TJEarnedCurrencyListener

◆ setUserCohortVariable()

static void tapjoy::Tapjoy::setUserCohortVariable ( int  variableIndex,
const char *  value 
)
static

Sets a variable of user for the cohort analysis.

Parameters
variableIndexthe index of the variable to set, must be in the range 1 to 5
valuethe value of the variable to set, or null to unset

◆ setUserConsent()

static void tapjoy::Tapjoy::setUserConsent ( const char *  value)
static

This is used for sending User's consent to behavioral advertising such as in the context of GDPR The consent value can be "0" (User has not provided consent), "1" (User has provided consent) or a daisybit string as suggested in IAB's Transparency and Consent Framework.

Deprecated:
Deprecated since version 12.6.0
Parameters
valueThe user consent string

◆ setUserFriendCount()

static void tapjoy::Tapjoy::setUserFriendCount ( int  friendCount)
static

Sets the friends count of the user.

Parameters
friendCountthe number of friends

◆ setUserID()

static void tapjoy::Tapjoy::setUserID ( const char *  userID)
static

Assigns a user ID for this user/device.

This is used to identify the user in your application.

This is REQUIRED for NON-MANAGED currency apps.

Parameters
userIDuser ID you wish to assign to this device

◆ setUserLevel()

static void tapjoy::Tapjoy::setUserLevel ( int  userLevel)
static

Sets the level of the user.

Parameters
userLevelthe level of the user

◆ setVideoListener()

static void tapjoy::Tapjoy::setVideoListener ( TJVideoListener listener)
static

Sets the video listener.

Use this to receive callbacks for on video start, complete and error.

Parameters
listenervideo to receive start/complete/error callbacks

◆ spendCurrency()

static void tapjoy::Tapjoy::spendCurrency ( int  amount,
TJSpendCurrencyListener listener 
)
static

Spends virtual currency.

This can only be used for currency managed by Tapjoy. The data will be returned in a callback to onSpendCurrencyResponse() to the class implementing the listener.

Parameters
listenerthe class implementing the TapjoySpendCurrencyListener callback

◆ startSession()

static void tapjoy::Tapjoy::startSession ( )
static

Manual session tracking.

Notifies the SDK that new session of your application has been started.

◆ subjectToGDPR()

static void tapjoy::Tapjoy::subjectToGDPR ( bool  gdprApplicable)
static

This can be used by the integrating App to indicate if the user falls in any of the GDPR applicable countries (European Economic Area).

Deprecated:
Deprecated since version 12.6.0

The value should be set to TRUE when User (Subject) is applicable to GDPR regulations and FALSE when User is not applicable to GDPR regulations. In the absence of this call, Tapjoy server makes the determination of GDPR applicability.

Parameters
gdprApplicabletrue if GDPR applies to this user, false otherwise

◆ trackEvent()

static void tapjoy::Tapjoy::trackEvent ( const char *  name,
int64_t  value 
)
static

Tracks an event of the given name without category, with a value.

Parameters
namethe name of event
valuethe value of event

◆ trackPurchase()

static void tapjoy::Tapjoy::trackPurchase ( const char *  productId,
const char *  currencyCode,
double  price,
const char *  campaignId 
)
static

Tracks a purchase.

Parameters
productIdthe product identifier
currencyCodethe currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
pricethe price of product
campaignIdthe campaign id of the Purchase Action Request if it initiated this purchase, can be null

The documentation for this class was generated from the following file: