C++ API class of the Tapjoy SDK. More...
#include <TapjoyCpp.h>
Static Public Member Functions | |
static void | setContext (jobject context) |
static const char * | getLibraryName () |
Returns the name of the library linked. | |
static const char * | getVersion () |
Returns the version name of the SDK. | |
static void | setDebugEnabled (bool enable) |
Enables the debug mode of the SDK. | |
static bool | connect (jobject context, const char *sdkKey, const std::map< const char *, const char * > &flags, TJConnectListener *listener=NULL) |
Connects to the Tapjoy Server. | |
static bool | connect (jobject context, const char *sdkKey, TJConnectListener *listener=NULL) |
Connects to the Tapjoy Server. | |
static void | optOutAdvertisingID (jobject context, bool optOut) |
This is to opt out passing advertising_id param in the subsequent network requests. | |
static bool | connect (const char *sdkKey, TJConnectListener *listener=NULL) |
Connects to the Tapjoy Server. | |
static bool | connect (const char *sdkKey, const std::map< const char *, const char * > &flags, TJConnectListener *listener=NULL) |
Connects to the Tapjoy Server. | |
static void | getCurrencyBalance (TJGetCurrencyBalanceListener *listener) |
Gets the virtual currency data from the server for this device. | |
static void | spendCurrency (int amount, TJSpendCurrencyListener *listener) |
Spends virtual currency. | |
static void | awardCurrency (int amount, TJAwardCurrencyListener *listener) |
Awards virtual currency. | |
static void | setEarnedCurrencyListener (TJEarnedCurrencyListener *listener) |
Sets the listener which gets informed whenever virtual currency is earned. | |
static void | trackPurchase (const char *currencyCode, double price) |
Tracks a purchase. | |
static void | trackPurchase (const char *productId, const char *currencyCode, double price, const char *campaignId) |
Tracks a purchase. | |
static void | trackPurchaseInGooglePlayStore (const char *skuDetails, const char *purchaseData, const char *dataSignature, const char *campaignId) |
Tracks a purchase with JSON data from the Google Play store. Also performs In-app Billing validation if purchaseData and dataSignature are given. | |
static void | startSession () |
Manual session tracking. | |
static void | endSession () |
Manual session tracking. | |
static void | setUserID (const char *userID, TJSetUserIDListener *listener) |
Assigns a user ID for this user/device. | |
static const char * | getUserID () |
Gets the id of the user. | |
static void | setCustomParameter (const char *referrer) |
Assign a custom parameter associated with any following placement requests that contains an ad type. | |
static const char * | getCustomParameter () |
Returns the currently set custom parameter. | |
static int | getUserLevel () |
Gets the level of the user. | |
static void | setUserLevel (int userLevel) |
Sets the level of the user. | |
static void | setMaxLevel (int maxLevel) |
Sets the maximum level of the user. | |
static int | getMaxLevel () |
Gets the maximum level of the user. | |
static void | setUserSegment (int userSegment) |
Sets the segment of the user. | |
static int | getUserSegment () |
Gets the segment of the user. | |
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. | |
static void | removeUserTag (const char *tag) |
Removes the given tag from the user if it is present. | |
static void | actionComplete (const char *actionID) |
Informs the Tapjoy server that the specified Pay-Per-Action was completed. Should be called whenever a user completes an in-game action. | |
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 |
|
static |
|
static |
|
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 |
Returns the currently set custom parameter.
|
static |
Gets the maximum level of the user.
|
static |
Gets the id of the user.
|
static |
Gets the level of the user.
|
static |
Gets the segment of the user.
|
static |
Returns the version name of the SDK.
|
static |
This is to opt out passing advertising_id param in the subsequent network requests.
context | |
optOut | set to true to opt out advertising_id in the subsequent requests, false to disable |
|
static |
Removes the given tag from the user if it is present.
tag | the tag to be removed |
|
static |
Assign a custom parameter associated with any following placement requests that contains an ad type.
We will return this value on the currency callback. Only applicable for publishers who manage their own currency servers. This value does NOT get unset with each subsequent placement request.
customParam | The custom parameter to assign to this device |
|
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 the maximum level of the user.
maxLevel | the maximum possible level |
|
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 segment of the user.
userSegment | NON_PAYER (0), PAYER (1), VIP (2) |
|
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 |
Tracks a purchase.
currencyCode | the currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW" |
price | the price of product |
|
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 |
|
static |
Tracks a purchase with JSON data from the Google Play store. Also performs In-app Billing validation if purchaseData and dataSignature are given.
skuDetails | a String in JSON Object format that contains product item details (according to Specification on Google Play) |
purchaseData | a String in JSON format that contains details about the purchase order. Use null not to use validation. |
dataSignature | String containing the signature of the purchase data that the developer signed with their private key. Use null not to use validation. |
campaignId | the campaign id of the Purchase Action Request if it initiated this purchase, can be null |