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. | |
C++ API class of the Tapjoy SDK.
|
static |
Informs the Tapjoy server that the specified Pay-Per-Action was completed.
Should be called whenever a user completes an in-game action.
actionID | The action ID of the completed action. |
|
static |
Adds the given tag to the user if it is not already present.
tag | the tag to be added |
|
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.
listener | the class implementing the TJAwardCurrencyListener callback |
|
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.
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.
isBelowConsentAge | True if below consent age (COPPA) applies to this user, false otherwise |
|
static |
|
static |
Manual session tracking.
Notifies the SDK that the session of your application has been ended.
|
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.
listener | the class implementing the TapjoyCurrencyBalanceListener callback |
|
static |
Gets the multiplier for the virtual currency display.
|
static |
Returns the version name of the SDK.
|
static |
Removes the given tag from the user if it is present.
tag | the tag to be removed |
|
static |
Sets the data version of the App or Game.
dataVersion | the data version |
|
static |
ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY.
Sets the multiplier for the virtual currency displayed in placements.
The default is 1.0
multiplier |
|
static |
Enables the debug mode of the SDK.
enable | true to enable |
|
static |
Sets the listener which gets informed whenever virtual currency is earned.
listener | class implementing TJEarnedCurrencyListener |
|
static |
Sets a variable of user for the cohort analysis.
variableIndex | the index of the variable to set, must be in the range 1 to 5 |
value | the value of the variable to set, or null to unset |
|
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.
value | The user consent string |
|
static |
Sets the friends count of the user.
friendCount | the number of friends |
|
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.
userID | user ID you wish to assign to this device |
|
static |
Sets the level of the user.
userLevel | the level of the user |
|
static |
Sets the video listener.
Use this to receive callbacks for on video start, complete and error.
listener | video to receive start/complete/error callbacks |
|
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.
listener | the class implementing the TapjoySpendCurrencyListener callback |
|
static |
Manual session tracking.
Notifies the SDK that new session of your application has been started.
|
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).
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.
gdprApplicable | true if GDPR applies to this user, false otherwise |
|
static |
Tracks an event of the given name without category, with a value.
name | the name of event |
value | the value of event |
|
static |
Tracks a purchase.
productId | the product identifier |
currencyCode | the currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW" |
price | the price of product |
campaignId | the campaign id of the Purchase Action Request if it initiated this purchase, can be null |