public final class Tapjoy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INTENT_EXTRA_PUSH_PAYLOAD
The name of the intent extra used to provide a payload of push when the app has
been launched by a push notification.
|
Constructor and Description |
---|
Tapjoy() |
Modifier and Type | Method and Description |
---|---|
static void |
actionComplete(java.lang.String actionID)
Informs the Tapjoy server that the specified Pay-Per-Action was
completed.
|
static void |
activateInstallReferrerClient(android.content.Context context)
Activates Tapjoy's client to retrieve the install referrer of app from Google Play Store.
|
static void |
addUserTag(java.lang.String tag)
Adds the given tag to the user if it is not already present.
|
static void |
awardCurrency(int amount,
TJAwardCurrencyListener listener)
Awards virtual currency.
|
static void |
belowConsentAge(boolean isBelowConsentAge)
Deprecated.
Deprecated since 12.6.0
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.
|
static void |
clearUserTags()
Removes all tags from the user.
|
static boolean |
connect(android.content.Context context,
java.lang.String sdkKey)
Connects to the Tapjoy Server
|
static boolean |
connect(android.content.Context context,
java.lang.String sdkKey,
java.util.Hashtable<java.lang.String,?> flags)
Connects to the Tapjoy Server
|
static boolean |
connect(android.content.Context applicationContext,
java.lang.String sdkKey,
java.util.Hashtable<java.lang.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 void |
endSession()
Manual session tracking.
|
static void |
getCurrencyBalance(TJGetCurrencyBalanceListener listener)
Gets the virtual currency data from the server for this device.
|
static float |
getCurrencyMultiplier()
Deprecated.
Deprecated since 11.4.0.
Gets the multiplier for the virtual currency display.
|
static java.lang.String |
getCustomParameter() |
static TJPlacement |
getLimitedPlacement(java.lang.String placementName,
TJPlacementListener listener) |
static TJPlacement |
getPlacement(java.lang.String placementName,
TJPlacementListener listener)
Creates a TJPlacement object used for requesting content
|
static TJPrivacyPolicy |
getPrivacyPolicy()
Returns the TJPrivacyPolicy instance for calling methods to set GDPR, User's consent, below consent age ,and US Privacy policy flags
|
static java.lang.String |
getSupportURL()
Returns URL to Tapjoy support web page.
|
static java.lang.String |
getSupportURL(java.lang.String currencyId)
Returns URL to Tapjoy support web page for specified currency
You can get your currencyId from the Tapjoy Dashboard under the currency section.
|
static java.util.Set<java.lang.String> |
getUserTags()
Returns a String set which contains tags on the user.
|
static java.lang.String |
getUserToken()
Returns a user token for programmatic mediation.
|
static java.lang.String |
getVersion()
Returns the version name of this SDK release.
|
static boolean |
isConnected()
Helper function to check if SDK is initialized
|
static boolean |
isLimitedConnected() |
static boolean |
isPushNotificationDisabled()
Returns true if the push notification is disabled.
|
static boolean |
limitedConnect(android.content.Context applicationContext,
java.lang.String sdkKey,
TJConnectListener publisherListener)
Used by limited SDK requests only
|
static void |
loadSharedLibrary()
Load the native shared library of the SDK to use C++ API.
|
static void |
onActivityStart(android.app.Activity activity)
Semi-auto session tracking.
|
static void |
onActivityStop(android.app.Activity activity)
Semi-auto session tracking.
|
static void |
removeUserTag(java.lang.String tag)
Removes the given tag from the user if it is present.
|
static void |
setActivity(android.app.Activity activity)
Sets the current activity
|
static void |
setAppDataVersion(java.lang.String dataVersion)
Deprecated.
Deprecated since 11.11.1.
Sets the data version of the App or Game.
|
static void |
setCurrencyMultiplier(float multiplier)
Deprecated.
Deprecated since 11.4.0.
ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY.
Sets the multiplier for the virtual currency displayed in Offers, Banner Ads, etc. The default is 1.0 |
static void |
setCustomParameter(java.lang.String customParam) |
static void |
setDebugEnabled(boolean enable)
Enables or disables Tapjoy logging
|
static void |
setDeviceToken(java.lang.String deviceToken)
Set Firebase Token to initiate Firebase messaging for your application.
|
static void |
setEarnedCurrencyListener(TJEarnedCurrencyListener listener)
Sets the listener which gets informed whenever virtual currency is
earned.
|
static void |
setGcmSender(java.lang.String senderId)
Sets the sender id to initiate GCM messaging registration for the your
application.
|
static void |
setGLSurfaceView(android.opengl.GLSurfaceView glSurfaceView)
Sets the GLSurfaceView to receive callbacks in the GL thread.
|
static void |
setInstallReferrer(android.content.Context context,
java.lang.String referrer)
Sets the referrer parameter for each install provided by the InstallReferrer API.
|
static void |
setPushNotificationDisabled(boolean disabled)
Sets whether the push notification is disabled.
|
static void |
setReceiveRemoteNotification(android.content.Context context,
java.util.Map<java.lang.String,java.lang.String> remoteMessage)
Sets the context and RemoteMessage data so that our SDK can display the push notification.
|
static void |
setUserCohortVariable(int variableIndex,
java.lang.String value)
Sets a variable of user for the cohort analysis.
|
static void |
setUserConsent(java.lang.String value)
Deprecated.
Deprecated since 12.6.0
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
|
static void |
setUserFriendCount(int friendCount)
Sets the friends count of the user.
|
static void |
setUserID(java.lang.String userID)
Assigns a user ID for this user/device.
|
static void |
setUserID(java.lang.String userID,
TJSetUserIDListener listener)
Assigns a user ID for this user/device.
|
static void |
setUserLevel(int userLevel)
Sets the level of the user.
|
static void |
setUserTags(java.util.Set<java.lang.String> tags)
Sets tags for the user.
|
static void |
setVideoListener(TJVideoListener listener)
Sets the video listener.
|
static void |
spendCurrency(int amount,
TJSpendCurrencyListener listener)
Spends virtual currency.
|
static void |
startSession()
Manual session tracking.
|
static void |
subjectToGDPR(boolean gdprApplicable)
Deprecated.
Deprecated since 12.6.0
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.
|
static void |
trackEvent(java.lang.String name)
Tracks an event of the given name without category
|
static void |
trackEvent(java.lang.String name,
long value)
Tracks an event of the given name without category, with a value.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
long value)
Tracks an event of the given category and name, with a value.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2)
Tracks an event of the given category and name, with two parameters.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2,
long value)
Tracks an event of the given category and name, with two parameters and a
value.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2,
java.util.Map<java.lang.String,java.lang.Long> values)
Tracks an event of the given category and name, with two parameters and a
Map of values.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2,
java.lang.String valueName,
long value)
Tracks an event of the given category and name, with two parameters and a
named values.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2,
java.lang.String value1Name,
long value1,
java.lang.String value2Name,
long value2)
Tracks an event of the given category and name, with two parameters and
two named values.
|
static void |
trackEvent(java.lang.String category,
java.lang.String name,
java.lang.String parameter1,
java.lang.String parameter2,
java.lang.String value1Name,
long value1,
java.lang.String value2Name,
long value2,
java.lang.String value3Name,
long value3)
Tracks an event of the given category and name, with two parameters and
three named values.
|
static void |
trackPurchase(java.lang.String skuDetails,
java.lang.String campaignId)
Deprecated.
Deprecated since 11.2.0.
Use trackPurchase(skuDetails, purchaseData, dataSignature, campaignId) instead.
Tracks a purchase with JSON data from the Google Play store
|
static void |
trackPurchase(java.lang.String productId,
java.lang.String currencyCode,
double price,
java.lang.String campaignId)
Tracks a purchase
|
static void |
trackPurchase(java.lang.String skuDetails,
java.lang.String purchaseData,
java.lang.String dataSignature,
java.lang.String campaignId)
Tracks a purchase with JSON data from the Google Play store.
|
public static final java.lang.String INTENT_EXTRA_PUSH_PAYLOAD
public static java.lang.String getVersion()
public static void setDebugEnabled(boolean enable)
enable
- set to true if logging should be enabled, false to disable
loggingpublic static boolean connect(android.content.Context context, java.lang.String sdkKey)
public static boolean connect(android.content.Context context, java.lang.String sdkKey, java.util.Hashtable<java.lang.String,?> flags)
public static boolean connect(android.content.Context applicationContext, java.lang.String sdkKey, java.util.Hashtable<java.lang.String,?> flags, TJConnectListener publisherListener)
TapjoyConnectFlag
for possible values.TJConnectListener
to receive callbacks on connect
success or failure.applicationContext
- The application context.sdkKey
- Your Tapjoy SDK Key.flags
- special connect flagspublisherListener
- listener for connect success/failurepublic static TJPlacement getPlacement(java.lang.String placementName, TJPlacementListener listener)
placementName
- placement name configured in the dashboardlistener
- listener for placement eventspublic static void setActivity(android.app.Activity activity)
activity
- public static void getCurrencyBalance(TJGetCurrencyBalanceListener listener)
listener
- the class implementing the TapjoyCurrencyBalanceListener
callbackpublic static void spendCurrency(int amount, TJSpendCurrencyListener listener)
listener
- the class implementing the TapjoySpendCurrencyListener
callbackpublic static void awardCurrency(int amount, TJAwardCurrencyListener listener)
listener
- the class implementing the TJAwardCurrencyListener
callbackpublic static void setEarnedCurrencyListener(TJEarnedCurrencyListener listener)
listener
- class implementing TJEarnedCurrencyListener@Deprecated public static void setCurrencyMultiplier(float multiplier)
multiplier
- @Deprecated public static float getCurrencyMultiplier()
public static void trackPurchase(java.lang.String productId, java.lang.String currencyCode, double price, java.lang.String campaignId)
productId
- the product identifiercurrencyCode
- the currency code of price as an alphabetic currency code
specified in ISO 4217, i.e. "USD", "KRW"price
- the price of productcampaignId
- the campaign id of the PurchaseRequest
if it initiated
this purchase, can be nullpublic static void trackPurchase(java.lang.String skuDetails, java.lang.String purchaseData, java.lang.String dataSignature, java.lang.String campaignId)
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 PurchaseRequest
if it initiated
this purchase, can be null@Deprecated public static void trackPurchase(java.lang.String skuDetails, java.lang.String campaignId)
skuDetails
- a String in JSON Object format that contains product item
details (according to Specification on Google Play)campaignId
- the campaign id of the PurchaseRequest
if it initiated
this purchase, can be nullpublic static void trackEvent(java.lang.String name)
trackEvent(String, long)
public static void trackEvent(java.lang.String name, long value)
name
- the name of eventvalue
- the value of eventpublic static void trackEvent(java.lang.String category, java.lang.String name, long value)
public static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2)
public static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2, long value)
public static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2, java.lang.String valueName, long value)
public static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2, java.lang.String value1Name, long value1, java.lang.String value2Name, long value2)
public static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2, java.lang.String value1Name, long value1, java.lang.String value2Name, long value2, java.lang.String value3Name, long value3)
category
- the category of event, can be nullname
- the name of eventparameter1
- the value of the 1st parameter of event, can be nullparameter2
- the value of the 2nd parameter of event, can be nullvalue1Name
- the name of the 1st value of eventvalue1
- the 1st value of eventvalue2Name
- the name of the 2nd value of eventvalue2
- the 2nd value of eventvalue3Name
- the name of the 3rd value of eventvalue3
- the 3rd value of eventpublic static void trackEvent(java.lang.String category, java.lang.String name, java.lang.String parameter1, java.lang.String parameter2, java.util.Map<java.lang.String,java.lang.Long> values)
category
- the category of event, can be nullname
- the name of eventparameter1
- the value of the 1st parameter of event, can be nullparameter2
- the value of the 2nd parameter of event, can be nullvalues
- Map that contains values of the eventpublic static void startSession()
public static void endSession()
public static void onActivityStart(android.app.Activity activity)
activity
- the new activity that is startingpublic static void onActivityStop(android.app.Activity activity)
activity
- the new activity that is stoppingpublic static void setUserID(java.lang.String userID)
userID
- user ID you wish to assign to this devicepublic static void setUserID(java.lang.String userID, TJSetUserIDListener listener)
userID
- user ID you wish to assign to this devicelistener
- listener for setUserID success/failurepublic static void setUserLevel(int userLevel)
userLevel
- the level of the userpublic static void setUserFriendCount(int friendCount)
friendCount
- the number of friendspublic static void setAppDataVersion(java.lang.String dataVersion)
dataVersion
- the data versionpublic static void setUserCohortVariable(int variableIndex, java.lang.String value)
variableIndex
- the index of the variable to set, must be in the range 1 to 5value
- the value of the variable to set, or null to unsetpublic static java.util.Set<java.lang.String> getUserTags()
public static void setUserTags(java.util.Set<java.lang.String> tags)
tags
- the tags to be setpublic static void clearUserTags()
public static void addUserTag(java.lang.String tag)
tag
- the tag to be addedpublic static void removeUserTag(java.lang.String tag)
tag
- the tag to be removedpublic static void setVideoListener(TJVideoListener listener)
listener
- video to receive start/complete/error callbackspublic static void actionComplete(java.lang.String actionID)
actionID
- The action ID of the completed action.public static void setGcmSender(java.lang.String senderId)
senderId
- Google Project ID of the accounts authorized to send messages
to your application.public static void setDeviceToken(java.lang.String deviceToken)
deviceToken
- deviceToken is a registration token for firebase senderID and AppID to register in Tapjoy Server.
It is updated through FirebaseInstanceIdService callback triggered everytime Firebase update the token.public static void setReceiveRemoteNotification(android.content.Context context, java.util.Map<java.lang.String,java.lang.String> remoteMessage)
context:
- The Application contextremoteMessage:
- The RemoteMessage.getData() map from the message received from Firebasepublic static void activateInstallReferrerClient(android.content.Context context)
context
- The Application contextpublic static void setInstallReferrer(android.content.Context context, java.lang.String referrer)
context
- The Application contextreferrer
- The install referrer string from ReferrerDetails.getInstallReferrer();public static boolean isPushNotificationDisabled()
public static void setPushNotificationDisabled(boolean disabled)
disabled
- true to disable the push notificationpublic static void loadSharedLibrary()
public static void setGLSurfaceView(android.opengl.GLSurfaceView glSurfaceView)
glSurfaceView
- public static java.lang.String getSupportURL()
public static java.lang.String getSupportURL(java.lang.String currencyId)
currencyId
- the app's currency idpublic static java.lang.String getUserToken()
public static boolean isConnected()
@Deprecated public static void subjectToGDPR(boolean gdprApplicable)
gdprApplicable
- True if GDPR applies to this user, false otherwise@Deprecated public static void setUserConsent(java.lang.String value)
value
- The user consent string@Deprecated public static void belowConsentAge(boolean isBelowConsentAge)
isBelowConsentAge
- True if below consent age (COPPA) applies to this user, false otherwisepublic static boolean limitedConnect(android.content.Context applicationContext, java.lang.String sdkKey, TJConnectListener publisherListener)
public static boolean isLimitedConnected()
public static TJPlacement getLimitedPlacement(java.lang.String placementName, TJPlacementListener listener)
public static void setCustomParameter(java.lang.String customParam)
public static java.lang.String getCustomParameter()
public static TJPrivacyPolicy getPrivacyPolicy()