Package com.tapjoy
Class Tapjoy
java.lang.Object
com.tapjoy.Tapjoy
Created by Tapjoy.
Copyright 2020 Tapjoy.com All rights reserved.
 
For information about SDK integration, best practices and FAQs, please go to http://dev.tapjoy.com
Copyright 2020 Tapjoy.com All rights reserved.
For information about SDK integration, best practices and FAQs, please go to http://dev.tapjoy.com
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidactionComplete(String actionID) Deprecated.Deprecated since 14.1.0.static voidaddUserTag(String tag) Adds the given tag to the user if it is not already present.static voidawardCurrency(int amount, TJAwardCurrencyListener listener) Awards virtual currency.static voidRemoves all tags from the user.static booleanConnects to the Tapjoy Serverstatic booleanConnects to the Tapjoy Serverstatic booleanconnect(android.content.Context applicationContext, String sdkKey, Hashtable<String, ?> flags, TJConnectListener publisherListener) Performs the Tapjoy Connect call to the Tapjoy server to notify it that this device is running your application.
 
 This method should be called in the onCreate() method of your first activity and before any other TapjoyConnect methods.
 
 For special flags, this is a hashtable of special flags to send to enable non-standard settings.static voidManual session tracking.static voidGets the virtual currency data from the server for this device.static StringReturns the currently set custom parameter.static intGets the maximum level of the user.static TJPlacementgetPlacement(String placementName, TJPlacementListener listener) Creates a TJPlacement object used for requesting contentstatic TJPrivacyPolicyReturns the TJPrivacyPolicy instance for calling methods to set GDPR, User's consent, below consent age ,and US Privacy policy flagsstatic StringDeprecated.Deprecated since 14.2.0 Returns URL to Tapjoy support web page.static StringgetSupportURL(String currencyId) Deprecated.Deprecated since 14.2.0 Returns URL to Tapjoy support web page for specified currency You can get your currencyId from the Tapjoy Dashboard under the currency section.static StringGets the ID of the user.static intGets the level of the user.static com.tapjoy.TJSegmentSets the segment of the userReturns a String set which contains tags on the user.static StringReturns the version name of this SDK release.static booleanHelper function to check if SDK is initializedstatic voidLoad the native shared library of the SDK to use C++ API.static voidonActivityStart(android.app.Activity activity) Semi-auto session tracking.static voidonActivityStop(android.app.Activity activity) Semi-auto session tracking.static voidoptOutAdvertisingID(android.content.Context context, boolean optOut) This is to opt out passing advertising_id param in the subsequent network requestsstatic voidremoveUserTag(String tag) Removes the given tag from the user if it is present.static voidsetActivity(android.app.Activity activity) Deprecated.Deprecated since 14.0.0 Sets the current activitystatic voidsetCustomParameter(String customParam) Assign a custom parameter associated with any following placement requests that contains an ad type.static voidsetDebugEnabled(boolean enable) Enables or disables Tapjoy loggingstatic voidSets the listener which gets informed whenever virtual currency is earned.static voidsetGLSurfaceView(android.opengl.GLSurfaceView glSurfaceView) Deprecated.Deprecated since 14.0.0.static voidsetMaxLevel(int maxUserLevel) Sets the maximum level of the user.static voidsetUserID(String userID, TJSetUserIDListener listener) Assigns a user ID for this user/device.static voidsetUserLevel(int userLevel) Sets the level of the user.static voidsetUserSegment(com.tapjoy.TJSegment userSegment) Sets the segment of the userstatic voidsetUserTags(Set<String> tags) Sets tags for the user.static voidspendCurrency(int amount, TJSpendCurrencyListener listener) Spends virtual currency.static voidManual session tracking.static voidtrackPurchase(String currencyCode, double price) Tracks a purchasestatic voidtrackPurchase(String productId, String currencyCode, double price, String campaignId) Deprecated.Deprecated since 14.0.0 Tracks a purchasestatic voidtrackPurchase(String skuDetails, String purchaseData, String dataSignature, String campaignId) Deprecated.Deprecated since 14.0.0.
- 
Constructor Details- 
Tapjoypublic Tapjoy()
 
- 
- 
Method Details- 
getVersionReturns the version name of this SDK release.- Returns:
- String instance which represents the version name
 
- 
setDebugEnabledpublic static void setDebugEnabled(boolean enable) Enables or disables Tapjoy logging- Parameters:
- enable- set to true if logging should be enabled, false to disable logging
 
- 
connectConnects to the Tapjoy Server- Parameters:
- context- The application context.
- sdkKey- Your Tapjoy SDK Key.
- Returns:
- true if successful
- See Also:
 
- 
connectpublic static boolean connect(android.content.Context context, String sdkKey, Hashtable<String, ?> flags) Connects to the Tapjoy Server- Parameters:
- context- The application context.
- sdkKey- Your Tapjoy SDK Key.
- flags- Special connect flags
- Returns:
- true if successful
- See Also:
 
- 
connectpublic static boolean connect(android.content.Context applicationContext, String sdkKey, Hashtable<String, ?> flags, TJConnectListener publisherListener) Performs the Tapjoy Connect call to the Tapjoy server to notify it that this device is running your application.
 
 This method should be called in the onCreate() method of your first activity and before any other TapjoyConnect methods.
 
 For special flags, this is a hashtable of special flags to send to enable non-standard settings. SeeTapjoyConnectFlagfor possible values.
 
 ImplementTJConnectListenerto receive callbacks on connect success or failure.- Parameters:
- applicationContext- The application context.
- sdkKey- Your Tapjoy SDK Key.
- flags- special connect flags
- publisherListener- listener for connect success/failure
- Returns:
- true if successful
 
- 
getPlacementCreates a TJPlacement object used for requesting content- Parameters:
- placementName- placement name configured in the dashboard
- listener- listener for placement events
- Returns:
- TJPlacement object
 
- 
setActivityDeprecated.Deprecated since 14.0.0 Sets the current activity- Parameters:
- activity- the reference to your activity
 
- 
getCurrencyBalanceGets 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:
- listener- the class implementing the TapjoyCurrencyBalanceListener callback
 
- 
spendCurrencySpends 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:
- amount- the amount of currency
- listener- the class implementing the TapjoySpendCurrencyListener callback
 
- 
awardCurrencyAwards 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:
- amount- the amount of currency
- listener- the class implementing the TJAwardCurrencyListener callback
 
- 
setEarnedCurrencyListenerSets the listener which gets informed whenever virtual currency is earned.- Parameters:
- listener- class implementing TJEarnedCurrencyListener
 
- 
trackPurchaseTracks a purchase- Parameters:
- currencyCode- the currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
- price- the price of product
 
- 
trackPurchase@Deprecated public static void trackPurchase(String productId, String currencyCode, double price, String campaignId) Deprecated.Deprecated since 14.0.0 Tracks a purchase- Parameters:
- 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 this purchase, can be null
 
- 
trackPurchase@Deprecated public static void trackPurchase(String skuDetails, String purchaseData, String dataSignature, String campaignId) Deprecated.Deprecated since 14.0.0. Tracks a purchase with JSON data from the Google Play store. Also performs In-app Billing validation if purchaseData and dataSignature are given.- Parameters:
- 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 this purchase, can be null
 
- 
startSessionpublic static void startSession()Manual session tracking. Notifies the SDK that new session of your application has been started.
- 
endSessionpublic static void endSession()Manual session tracking. Notifies the SDK that the session of your application has been ended.
- 
onActivityStartpublic static void onActivityStart(android.app.Activity activity) Semi-auto session tracking. Call this during onStart() of every Activity- Parameters:
- activity- the new activity that is starting
 
- 
onActivityStoppublic static void onActivityStop(android.app.Activity activity) Semi-auto session tracking. Call this during onStop() of every Activity.- Parameters:
- activity- the new activity that is stopping
 
- 
setUserIDAssigns 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:
- userID- user ID you wish to assign to this device
- listener- listener for setUserID success/failure
 
- 
getUserIDGets the ID of the user.- Returns:
- the id of the user.
 
- 
getUserLevelpublic static int getUserLevel()Gets the level of the user.- Returns:
- the level of the user.
 
- 
setUserLevelpublic static void setUserLevel(int userLevel) Sets the level of the user.- Parameters:
- userLevel- the level of the user
 
- 
setMaxLevelpublic static void setMaxLevel(int maxUserLevel) Sets the maximum level of the user.- Parameters:
- maxUserLevel- the maximum level
 
- 
getMaxLevelpublic static int getMaxLevel()Gets the maximum level of the user.- Returns:
- the maximum level
 
- 
setUserSegmentpublic static void setUserSegment(com.tapjoy.TJSegment userSegment) Sets the segment of the user- Parameters:
- userSegment- NON_PAYER (0), PAYER (1), VIP (2)
 
- 
getUserSegmentpublic static com.tapjoy.TJSegment getUserSegment()Sets the segment of the user- Returns:
- userSegment NON_PAYER (0), PAYER (1), VIP (2)
 
- 
getUserTagsReturns a String set which contains tags on the user.- Returns:
- list of user tags
 
- 
setUserTagsSets tags for the user.- Parameters:
- tags- the tags to be set
 
- 
clearUserTagspublic static void clearUserTags()Removes all tags from the user.
- 
addUserTagAdds the given tag to the user if it is not already present.- Parameters:
- tag- the tag to be added
 
- 
removeUserTagRemoves the given tag from the user if it is present.- Parameters:
- tag- the tag to be removed
 
- 
actionCompleteDeprecated.Deprecated since 14.1.0. Informs the Tapjoy server that the specified Pay-Per-Action was completed. Should be called whenever a user completes an in-game action.- Parameters:
- actionID- The action ID of the completed action.
 
- 
setGLSurfaceViewDeprecated.Deprecated since 14.0.0. Sets the GLSurfaceView to receive callbacks in the GL thread.- Parameters:
- glSurfaceView- view for callbacks
 
- 
getSupportURLDeprecated.Deprecated since 14.2.0 Returns URL to Tapjoy support web page. This will use your default currency.- Returns:
- URL of Tapjoy support web page
 
- 
getSupportURLDeprecated.Deprecated since 14.2.0 Returns URL to Tapjoy support web page for specified currency You can get your currencyId from the Tapjoy Dashboard under the currency section.- Parameters:
- currencyId- the app's currency id
- Returns:
- URL of Tapjoy support web page for specified currency
 
- 
isConnectedpublic static boolean isConnected()Helper function to check if SDK is initialized- Returns:
- true if successful
 
- 
setCustomParameterAssign 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.- Parameters:
- customParam- The custom parameter to assign to this device
 
- 
getCustomParameterReturns the currently set custom parameter.- Returns:
- the value of the currently set custom parameter.
 
- 
getPrivacyPolicyReturns the TJPrivacyPolicy instance for calling methods to set GDPR, User's consent, below consent age ,and US Privacy policy flags- Returns:
- The globally accessible singleton TJPrivacyPolicy instance
 
- 
optOutAdvertisingIDpublic static void optOutAdvertisingID(android.content.Context context, boolean optOut) This is to opt out passing advertising_id param in the subsequent network requests- Parameters:
- context- The application context.
- optOut- Enables or disables advertisingID opt out
 
 
-