Tapjoy SDK - C# API
TapjoyUnity.Tapjoy Class Reference

Public Member Functions

delegate void OnConnectSuccessHandler ()
 Delegate to be called when the SDK is connected.
 
delegate void OnConnectFailureHandler ()
 Delegate to be called when the SDK fails to connect.
 
delegate void OnSetUserIDSuccessHandler ()
 Delegate to be called when the SDK has set User ID.
 
delegate void OnSetUserIDFailureHandler (string errorMessage)
 Delegate to be called when the SDK fails to set User ID.
 
delegate void OnGetCurrencyBalanceResponseHandler (string currencyName, int balance)
 Delegate to be called with virtual currency name and total balance information when GetCurrencyBalance is successful. More...
 
delegate void OnGetCurrencyBalanceResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if GetCurrencyBalance fails. More...
 
delegate void OnSpendCurrencyResponseHandler (string currencyName, int balance)
 Delegate to be called with virtual currency name and total balance information when SpendCurrency is successful. More...
 
delegate void OnSpendCurrencyResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if SpendCurrency fails. More...
 
delegate void OnAwardCurrencyResponseHandler (string currencyName, int balance)
 Delegate to be called with virtual currency name and total balance information when AwardCurrency is successful. More...
 
delegate void OnAwardCurrencyResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if AwardCurrency fails. More...
 
delegate void OnEarnedCurrencyHandler (string currencyName, int amount)
 Delegate to be called whenever virtual currency has been earned. More...
 
delegate void OnVideoStartHandler ()
 Delegate to be called when a video starts playing.
 
delegate void OnVideoErrorHandler (string errorMessage)
 Delegate to be called when a video related error occurs. More...
 
delegate void OnVideoCompleteHandler ()
 Delegate to be called when a video has completed playing.
 

Static Public Member Functions

static void Connect ()
 Connect to the Tapjoy SDK If Tapjoy fails to connect due to a network issue, you can try connecting later by yourself using this method. More...
 
static void Connect (string sdkKey)
 Connect to the Tapjoy SDK with Tapjoy sdkKey. More...
 
static void Connect (string sdkKey, Dictionary< string, System.Object > connectFlags)
 Connect to the Tapjoy SDK with Tapjoy sdkKey. More...
 
static void SetDebugEnabled (bool enable)
 Enables the debug mode of the SDK. More...
 
static void SetGcmSender (string senderId)
 Sets the sender id to initiate GCM messaging registration for the your application. More...
 
static void SubjectToGDPR (bool subject)
 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 (string consent)
 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)
 
static void ActionComplete (string actionID)
 Informs the Tapjoy server that the specified Pay-Per-Action was completed. More...
 
static void SetAppDataVersion (string dataVersion)
 Sets the data version of the App or Game. More...
 
static void SetUserID (string userId)
 Sets the identifier of the user. 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 SetUserCohortVariable (int variableIndex, string value)
 Sets a variable of user for the cohort analysis. More...
 
static void ClearUserTags ()
 Removes all tags from the user.
 
static List< string > GetUserTags ()
 Get all tags from the user.
 
static void AddUserTag (string tag)
 Adds the given tag to the user if it is not already present. More...
 
static void RemoveUserTag (string tag)
 Removes the given tag from the user if it is present. More...
 
static void TrackEvent (string name, long value=0)
 Tracks an event of the given name without category, with a value. More...
 
static void TrackEvent (string category, string name, long value)
 Tracks an event of the given category and name, with a value. More...
 
static void TrackEvent (string category, string name, string parameter1, string parameter2=null, long value=0)
 Tracks an event of the given category and name, with two parameters and a value. More...
 
static void TrackEvent (string category, string name, string parameter1, string parameter2, string value1Name, long value1, string value2Name=null, long value2=0, string value3Name=null, long value3=0)
 Tracks an event of the given category and name, with two parameters and three named values. More...
 
static void TrackPurchase (string productId, string currencyCode, double productPrice, string campaignId=null)
 Tracks the purchase. More...
 
static void TrackPurchaseInGooglePlayStore (string skuDetails, string purchaseData, string dataSignature, string campaignId=null)
 Tracks a purchase with JSON data from the Google Play store. More...
 
static void TrackPurchaseInAppleAppStore (string productId, string currencyCode, double productPrice, string transactionId, string campaignId=null)
 Tracks a purchase from the Apple App Store. More...
 
static bool IsPushNotificationDisabled ()
 Returns true if the push notification is disabled when target platform is Android Returns false otherwise.
 
static void SetPushNotificationDisabled (bool disabled)
 Sets whether the push notification is disabled. More...
 
static void SetDeviceToken (string deviceToken)
 Set Firebase Token to initiate Firebase messaging for your application. More...
 
static void SetReceiveRemoteNotification (Dictionary< string, string > remoteMessage)
 Set MessageReceivedEventArgs.Message data so that our SDK can display the push notification. More...
 
static void ActivateInstallReferrerClient ()
 Activates Tapjoy's client to retrieve the install referrer of app from Google Play Store. More...
 
static void SetInstallReferrer (string referrer)
 Sets the referrer parameter for each install provided by the InstallReferrer API. More...
 
static void AwardCurrency (int amount)
 Awards virtual currency. More...
 
static void GetCurrencyBalance ()
 Gets the virtual currency data from the server for this device. More...
 
static void SpendCurrency (int amount)
 Spends virtual currency. More...
 
static float GetCurrencyMultiplier ()
 Gets the multiplier for the virtual currency display. More...
 
static void SetCurrencyMultiplier (float multiplier)
 Sets the multiplier for the virtual currency displayed in Offers, Banner Ads, etc. More...
 
static string GetSupportURL ()
 Returns URL to Tapjoy support web page. More...
 
static string GetSupportURL (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. More...
 
static void ShowDefaultEarnedCurrencyAlert ()
 Shows default alert that tells the user how much currency they just earned.
 

Properties

static string Version [get]
 Returns the version name of the SDK. More...
 
static bool IsConnected [get, set]
 Checks if SDK is connected. More...
 
static OnConnectSuccessHandler OnConnectSuccess
 Event for OnConnectSuccessHandler.
 
static OnConnectFailureHandler OnConnectFailure
 Event for OnConnectFailureHandler.
 
static OnSetUserIDSuccessHandler OnSetUserIDSuccess
 Event for OnSetUserIDSuccessHandler.
 
static OnSetUserIDFailureHandler OnSetUserIDFailure
 Event for OnSetUserIDFailureHandler.
 
static OnGetCurrencyBalanceResponseHandler OnGetCurrencyBalanceResponse
 Event for OnGetCurrencyBalanceResponseHandler.
 
static OnGetCurrencyBalanceResponseFailureHandler OnGetCurrencyBalanceResponseFailure
 Event for OnGetCurrencyBalanceResponseFailureHandler.
 
static OnSpendCurrencyResponseHandler OnSpendCurrencyResponse
 Event for OnSpendCurrencyResponseHandler.
 
static OnSpendCurrencyResponseFailureHandler OnSpendCurrencyResponseFailure
 Event for OnSpendCurrencyResponseFailureHandler.
 
static OnAwardCurrencyResponseHandler OnAwardCurrencyResponse
 Event for OnAwardCurrencyResponseHandler.
 
static OnAwardCurrencyResponseFailureHandler OnAwardCurrencyResponseFailure
 Event for OnAwardCurrencyResponseFailureHandler.
 
static OnEarnedCurrencyHandler OnEarnedCurrency
 Event for OnEarnedCurrencyHandler.
 
static OnVideoStartHandler OnVideoStart
 Event for OnVideoStartHandler.
 
static OnVideoErrorHandler OnVideoError
 Event for OnVideoErrorHandler.
 
static OnVideoCompleteHandler OnVideoComplete
 Event for OnVideoCompleteHandler.
 

Member Function Documentation

◆ ActionComplete()

static void TapjoyUnity.Tapjoy.ActionComplete ( string  actionID)
inlinestatic

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

◆ ActivateInstallReferrerClient()

static void TapjoyUnity.Tapjoy.ActivateInstallReferrerClient ( )
inlinestatic

Activates Tapjoy's client to retrieve the install referrer of app from Google Play Store.

The client setup and setting the referrer will happen only once per install. Call this when the app is launched.

◆ AddUserTag()

static void TapjoyUnity.Tapjoy.AddUserTag ( string  tag)
inlinestatic

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

Parameters
tagthe tag to be added

◆ AwardCurrency()

static void TapjoyUnity.Tapjoy.AwardCurrency ( int  amount)
inlinestatic

Awards virtual currency.

This can only be used for currency managed by Tapjoy. The data will be delivered to the delegates subscribing OnAwardCurrencyResponse and OnAwardCurrencyResponseFailure

Parameters
amountAmount of the currency

◆ BelowConsentAge()

static void TapjoyUnity.Tapjoy.BelowConsentAge ( bool  isBelowConsentAge)
inlinestatic
Deprecated:
Deprecated since version 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.

Parameters
isBelowConsentAgeTrue if below consent age (COPPA) applies to this user, false otherwise

◆ Connect() [1/3]

static void TapjoyUnity.Tapjoy.Connect ( )
inlinestatic

Connect to the Tapjoy SDK If Tapjoy fails to connect due to a network issue, you can try connecting later by yourself using this method.

This call will reuse the same paramters from the last connect call. The result of the call is passed via OnConnectSuccess or OnConnectFailure.

◆ Connect() [2/3]

static void TapjoyUnity.Tapjoy.Connect ( string  sdkKey)
inlinestatic

Connect to the Tapjoy SDK with Tapjoy sdkKey.

Make sure to pass in the correct sdkKey based on platform. The result of the call is passed via OnConnectSuccess or OnConnectFailure.

Parameters
sdkKeyTapjoy sdkKey to use for this connect

◆ Connect() [3/3]

static void TapjoyUnity.Tapjoy.Connect ( string  sdkKey,
Dictionary< string, System.Object >  connectFlags 
)
inlinestatic

Connect to the Tapjoy SDK with Tapjoy sdkKey.

Make sure to pass in the correct sdkKey based on platform. Connect settings are defaulty taken from the Tapjoy Unity Editor window, but can be overriden / set dynamically using connectFlags. The result of the call is passed via OnConnectSuccess or OnConnectFailure.

Parameters
sdkKeyTapjoy sdkKey to use for this connect

◆ GetCurrencyBalance()

static void TapjoyUnity.Tapjoy.GetCurrencyBalance ( )
inlinestatic

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

The data will be delivered to the delegates subscribing OnGetCurrencyBalanceResponse and OnGetCurrencyBalanceResponseFailure

◆ GetCurrencyMultiplier()

static float TapjoyUnity.Tapjoy.GetCurrencyMultiplier ( )
inlinestatic

Gets the multiplier for the virtual currency display.

Deprecated:
Deprecated since version 11.4.0
Returns
Currency multiplier.

◆ GetSupportURL() [1/2]

static string TapjoyUnity.Tapjoy.GetSupportURL ( )
inlinestatic

Returns URL to Tapjoy support web page.

This will use your default currency.

Returns
URL of Tapjoy support web page

◆ GetSupportURL() [2/2]

static string TapjoyUnity.Tapjoy.GetSupportURL ( string  currencyID)
inlinestatic

Returns URL to Tapjoy support web page for specified currency You can get your currencyId from the Tapjoy Dashboard under the currency section.

Parameters
currencyIdthe app's currency id
Returns
URL of Tapjoy support web page for specified currency

◆ OnAwardCurrencyResponseFailureHandler()

delegate void TapjoyUnity.Tapjoy.OnAwardCurrencyResponseFailureHandler ( string  errorMessage)

Delegate to be notified error message if AwardCurrency fails.

Parameters
errorMessageThe error message for a failed request

◆ OnAwardCurrencyResponseHandler()

delegate void TapjoyUnity.Tapjoy.OnAwardCurrencyResponseHandler ( string  currencyName,
int  balance 
)

Delegate to be called with virtual currency name and total balance information when AwardCurrency is successful.

Parameters
currencyNameThe name of the virtual currency.
balanceCurrency balance.

◆ OnEarnedCurrencyHandler()

delegate void TapjoyUnity.Tapjoy.OnEarnedCurrencyHandler ( string  currencyName,
int  amount 
)

Delegate to be called whenever virtual currency has been earned.

This can get called on a GetCurrencyBalance call.

Parameters
currencyNameVirtual currency name
amountAmount of virtual currency earned (delta).

◆ OnGetCurrencyBalanceResponseFailureHandler()

delegate void TapjoyUnity.Tapjoy.OnGetCurrencyBalanceResponseFailureHandler ( string  errorMessage)

Delegate to be notified error message if GetCurrencyBalance fails.

Parameters
errorMessageThe error message for a failed request

◆ OnGetCurrencyBalanceResponseHandler()

delegate void TapjoyUnity.Tapjoy.OnGetCurrencyBalanceResponseHandler ( string  currencyName,
int  balance 
)

Delegate to be called with virtual currency name and total balance information when GetCurrencyBalance is successful.

Parameters
currencyNameThe name of the virtual currency.
balanceCurrency balance.

◆ OnSpendCurrencyResponseFailureHandler()

delegate void TapjoyUnity.Tapjoy.OnSpendCurrencyResponseFailureHandler ( string  errorMessage)

Delegate to be notified error message if SpendCurrency fails.

Parameters
errorMessageThe error message for a failed request

◆ OnSpendCurrencyResponseHandler()

delegate void TapjoyUnity.Tapjoy.OnSpendCurrencyResponseHandler ( string  currencyName,
int  balance 
)

Delegate to be called with virtual currency name and total balance information when SpendCurrency is successful.

Parameters
currencyNameThe name of the virtual currency.
balanceCurrency balance.

◆ OnVideoErrorHandler()

delegate void TapjoyUnity.Tapjoy.OnVideoErrorHandler ( string  errorMessage)

Delegate to be called when a video related error occurs.

Parameters
errorMessageError message

◆ RemoveUserTag()

static void TapjoyUnity.Tapjoy.RemoveUserTag ( string  tag)
inlinestatic

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

Parameters
tagthe tag to be removed

◆ SetAppDataVersion()

static void TapjoyUnity.Tapjoy.SetAppDataVersion ( string  dataVersion)
inlinestatic

Sets the data version of the App or Game.

Deprecated:
Deprecated since version 11.11.1
Parameters
dataVersionthe data version

◆ SetCurrencyMultiplier()

static void TapjoyUnity.Tapjoy.SetCurrencyMultiplier ( float  multiplier)
inlinestatic

Sets the multiplier for the virtual currency displayed in Offers, Banner Ads, etc.

Deprecated:
Deprecated since version 11.4.0

The default is 1.0 ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY.

Parameters
multiplierThe currency multiplier

◆ SetDebugEnabled()

static void TapjoyUnity.Tapjoy.SetDebugEnabled ( bool  enable)
inlinestatic

Enables the debug mode of the SDK.

Parameters
enableset to true if logging should be enabled false to disable logging

◆ SetDeviceToken()

static void TapjoyUnity.Tapjoy.SetDeviceToken ( string  deviceToken)
inlinestatic

Set Firebase Token to initiate Firebase messaging for your application.

Call this method when the onTokenReceived callback is triggered to update the token.

Parameters
deviceTokenA deviceToken is a registration token for firebase senderID and AppID to register in Tapjoy Server. It is updated through onTokenReceived callback triggered everytime Firebase update the token.

◆ SetGcmSender()

static void TapjoyUnity.Tapjoy.SetGcmSender ( string  senderId)
inlinestatic

Sets the sender id to initiate GCM messaging registration for the your application.

Parameters
senderIdGoogle Project ID of the accounts authorized to send messages to your application.

◆ SetInstallReferrer()

static void TapjoyUnity.Tapjoy.SetInstallReferrer ( string  referrer)
inlinestatic

Sets the referrer parameter for each install provided by the InstallReferrer API.

If activateInstallReferrerClient is used, this method does not need to be used as we will call it automatically from setInstallReferrerClient.

Parameters
referrerThe install referrer string from ReferrerDetails.getInstallReferrer();

◆ SetPushNotificationDisabled()

static void TapjoyUnity.Tapjoy.SetPushNotificationDisabled ( bool  disabled)
inlinestatic

Sets whether the push notification is disabled.

(Only for Android)

Parameters
disabledtrue to disable the push notification

◆ SetReceiveRemoteNotification()

static void TapjoyUnity.Tapjoy.SetReceiveRemoteNotification ( Dictionary< string, string >  remoteMessage)
inlinestatic

Set MessageReceivedEventArgs.Message data so that our SDK can display the push notification.

Call this when a message is received from Firebase through OnMessageReceived callback trigger

Parameters
remoteMessageThe MessageReceivedEventArgs.Message.Data dictionary from the message received from Firebase

◆ SetUserCohortVariable()

static void TapjoyUnity.Tapjoy.SetUserCohortVariable ( int  variableIndex,
string  value 
)
inlinestatic

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 TapjoyUnity.Tapjoy.SetUserConsent ( string  consent)
inlinestatic

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 TapjoyUnity.Tapjoy.SetUserFriendCount ( int  friendCount)
inlinestatic

Sets the friends count of the user.

Parameters
friendCountthe number of friends

◆ SetUserID()

static void TapjoyUnity.Tapjoy.SetUserID ( string  userId)
inlinestatic

Sets the identifier of the user.

Parameters
userIdthe identifier of the user

◆ SetUserLevel()

static void TapjoyUnity.Tapjoy.SetUserLevel ( int  userLevel)
inlinestatic

Sets the level of the user.

Parameters
userLevelthe level of the user

◆ SpendCurrency()

static void TapjoyUnity.Tapjoy.SpendCurrency ( int  amount)
inlinestatic

Spends virtual currency.

This can only be used for currency managed by Tapjoy. The data will be delivered to the delegates subscribing OnSpendCurrencyResponse and OnSpendCurrencyResponseFailure

Parameters
amountAmount of the currency

◆ SubjectToGDPR()

static void TapjoyUnity.Tapjoy.SubjectToGDPR ( bool  subject)
inlinestatic

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() [1/4]

static void TapjoyUnity.Tapjoy.TrackEvent ( string  name,
long  value = 0 
)
inlinestatic

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

Parameters
namethe name of event
valuethe value of event

◆ TrackEvent() [2/4]

static void TapjoyUnity.Tapjoy.TrackEvent ( string  category,
string  name,
long  value 
)
inlinestatic

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

Parameters
categorythe category of event
namethe name of event
valuethe value of event

◆ TrackEvent() [3/4]

static void TapjoyUnity.Tapjoy.TrackEvent ( string  category,
string  name,
string  parameter1,
string  parameter2 = null,
long  value = 0 
)
inlinestatic

Tracks an event of the given category and name, with two parameters and a value.

Parameters
categorythe category of event, can be null
namethe name of event
parameter1the value of the 1st parameter of event, can be null
parameter2the value of the 2nd parameter of event, can be null
valuethe value of event

◆ TrackEvent() [4/4]

static void TapjoyUnity.Tapjoy.TrackEvent ( string  category,
string  name,
string  parameter1,
string  parameter2,
string  value1Name,
long  value1,
string  value2Name = null,
long  value2 = 0,
string  value3Name = null,
long  value3 = 0 
)
inlinestatic

Tracks an event of the given category and name, with two parameters and three named values.

Parameters
categorythe category of event, can be null
namethe name of event
parameter1the value of the 1st parameter of event, can be null
parameter2the value of the 2nd parameter of event, can be null
value1Namethe name of the 1st value of event
value1the 1st value of event
value2Namethe name of the 2nd value of event
value2the 2nd value of event
value3Namethe name of the 3rd value of event
value3the 3rd value of event

◆ TrackPurchase()

static void TapjoyUnity.Tapjoy.TrackPurchase ( string  productId,
string  currencyCode,
double  productPrice,
string  campaignId = null 
)
inlinestatic

Tracks the purchase.

Parameters
productIdthe product identifier
currencyCodethe currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
productPricethe price of product
campaignIdthe campaign id of the purchase ActionRequest which initiated this purchase, can be null

◆ TrackPurchaseInAppleAppStore()

static void TapjoyUnity.Tapjoy.TrackPurchaseInAppleAppStore ( string  productId,
string  currencyCode,
double  productPrice,
string  transactionId,
string  campaignId = null 
)
inlinestatic

Tracks a purchase from the Apple App Store.

Parameters
productIdthe identifier of product
currencyCodethe currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
pricethe price of product
transactionIdthe identifier of iap transaction, if this is given, we will check receipt validation. (Available in iOS 7.0 and later)
campaignIdthe campaign id of the purchase request which initiated this purchase, can be null

◆ TrackPurchaseInGooglePlayStore()

static void TapjoyUnity.Tapjoy.TrackPurchaseInGooglePlayStore ( string  skuDetails,
string  purchaseData,
string  dataSignature,
string  campaignId = null 
)
inlinestatic

Tracks a purchase with JSON data from the Google Play store.

Also performs In-app Billing validation if purchaseData and dataSignature are given.

Parameters
skuDetailsa String in JSON Object format that contains product item details (according to Specification on Google Play)
purchaseDataa String in JSON format that contains details about the purchase order. Use null not to use validation.
dataSignatureString containing the signature of the purchase data that the developer signed with their private key. Use null not to use validation.
campaignIdthe campaign id of the Purchase Action Request if it initiated this purchase, can be null

Property Documentation

◆ IsConnected

bool TapjoyUnity.Tapjoy.IsConnected
staticgetset

Checks if SDK is connected.

Returns
true if SDK is connected false otherwise

◆ Version

string TapjoyUnity.Tapjoy.Version
staticget

Returns the version name of the SDK.

Returns
a string which represents the version name

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