Tapjoy SDK - C# API
 
Loading...
Searching...
No Matches
TapjoyUnity.Tapjoy Class Reference

Public Member Functions

delegate void OnConnectSuccessHandler ()
 Delegate to be called when the SDK is connected.
 
delegate void OnConnectFailedHandler (int code, string message)
 Delegate to be called when the SDK fails to connect.
 
delegate void OnConnectWarningHandler (int code, string message)
 Delegate to be called when the SDK returns a warning.
 
delegate void OnSetUserIDSuccessHandler ()
 Delegate to be called when the SDK has set User ID.
 
delegate void OnSetUserIDFailedHandler (int code, string errorMessage)
 Delegate to be called when the SDK fails to 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.
 
delegate void OnGetCurrencyBalanceResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if GetCurrencyBalance fails.
 
delegate void OnSpendCurrencyResponseHandler (string currencyName, int balance)
 Delegate to be called with virtual currency name and total balance information when SpendCurrency is successful.
 
delegate void OnSpendCurrencyResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if SpendCurrency fails.
 
delegate void OnAwardCurrencyResponseHandler (string currencyName, int balance)
 Delegate to be called with virtual currency name and total balance information when AwardCurrency is successful.
 
delegate void OnAwardCurrencyResponseFailureHandler (string errorMessage)
 Delegate to be notified error message if AwardCurrency fails.
 
delegate void OnEarnedCurrencyHandler (string currencyName, int amount)
 Delegate to be called whenever virtual currency has been earned.
 

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.
 
static void Connect (string sdkKey)
 Connect to the Tapjoy SDK with Tapjoy sdkKey.
 
static void Connect (string sdkKey, Dictionary< string, System.Object > connectFlags)
 Connect to the Tapjoy SDK with Tapjoy sdkKey.
 
static void SetDebugEnabled (bool enable)
 Enables the debug mode of the SDK.
 
static void OptOutAdvertisingID (bool optOut)
 Restricts access to Google AdvertisingID.
 
static void ActionComplete (string 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 void SetUserID (string userId)
 Sets the identifier of the user.
 
static string GetUserID ()
 Gets the identifier of the user.
 
static void SetCustomParameter (string customParam)
 Assigns a custom parameter associated with any following placement requests that contains an ad type.
 
static string GetCustomParameter ()
 Returns the currently set custom parameter.
 
static void SetUserLevel (int userLevel)
 Sets the level of the user.
 
static int GetUserLevel ()
 Returns the level of the user.
 
static void SetMaxLevel (int maxUserLevel)
 Sets the maximum level of the user.
 
static int GetMaxLevel ()
 Gets the maximum level of the user.
 
static void SetUserSegment (TJSegment userSegment)
 
static TJSegment GetUserSegment ()
 
static double GetScreenScale ()
 
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.
 
static void RemoveUserTag (string tag)
 Removes the given tag from the user if it is present.
 
static void TrackPurchase (string currencyCode, double productPrice)
 Tracks the purchase.
 
static void TrackPurchase (string productId, string currencyCode, double productPrice, string campaignId=null)
 Tracks the purchase.
 
static void TrackPurchaseInGooglePlayStore (string skuDetails, string purchaseData, string dataSignature, string campaignId=null)
 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 TrackPurchaseInAppleAppStore (string productId, string currencyCode, double productPrice, string transactionId, string campaignId=null)
 Tracks a purchase from the Apple App Store.
 
static void AwardCurrency (int amount)
 Awards virtual currency.
 
static void GetCurrencyBalance ()
 Gets the virtual currency data from the server for this device.
 
static void SpendCurrency (int amount)
 Spends virtual currency.
 
static string GetSupportURL ()
 Returns URL to Tapjoy support web page. This will use your default currency.
 
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.
 
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.
 
static bool IsConnected [get, set]
 Checks if SDK is connected.
 

Events

static OnConnectSuccessHandler OnConnectSuccess [add, remove]
 Event for OnConnectSuccessHandler.
 
static OnConnectFailedHandler OnConnectFailed [add, remove]
 Event for OnConnectFailedHandler.
 
static OnConnectWarningHandler OnConnectWarning [add, remove]
 Event for OnConnectWarningHandler.
 
static OnSetUserIDSuccessHandler OnSetUserIDSuccess [add, remove]
 Event for OnSetUserIDSuccessHandler.
 
static OnSetUserIDFailedHandler OnSetUserIDFailed [add, remove]
 Event for OnSetUserIDFailedHandler.
 
static OnSetUserIDFailureHandler OnSetUserIDFailure [add, remove]
 Event for OnSetUserIDFailureHandler.
 
static OnGetCurrencyBalanceResponseHandler OnGetCurrencyBalanceResponse [add, remove]
 Event for OnGetCurrencyBalanceResponseHandler.
 
static OnGetCurrencyBalanceResponseFailureHandler OnGetCurrencyBalanceResponseFailure [add, remove]
 Event for OnGetCurrencyBalanceResponseFailureHandler.
 
static OnSpendCurrencyResponseHandler OnSpendCurrencyResponse [add, remove]
 Event for OnSpendCurrencyResponseHandler.
 
static OnSpendCurrencyResponseFailureHandler OnSpendCurrencyResponseFailure [add, remove]
 Event for OnSpendCurrencyResponseFailureHandler.
 
static OnAwardCurrencyResponseHandler OnAwardCurrencyResponse [add, remove]
 Event for OnAwardCurrencyResponseHandler.
 
static OnAwardCurrencyResponseFailureHandler OnAwardCurrencyResponseFailure [add, remove]
 Event for OnAwardCurrencyResponseFailureHandler.
 
static OnEarnedCurrencyHandler OnEarnedCurrency [add, remove]
 Event for OnEarnedCurrencyHandler.
 

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.

Deprecated
Deprecated since version 14.1.0
Parameters
actionIDThe action ID of the completed action

◆ 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

◆ 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 OnConnectFailed.

◆ 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 OnConnectFailed.

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 OnConnectFailed.

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

◆ GetCustomParameter()

static string TapjoyUnity.Tapjoy.GetCustomParameter ( )
inlinestatic

Returns the currently set custom parameter.

Returns
the value of the currently set custom parameter

◆ GetMaxLevel()

static int TapjoyUnity.Tapjoy.GetMaxLevel ( )
inlinestatic

Gets the maximum level of the user.

Returns
the maximum level

◆ GetSupportURL() [1/2]

static string TapjoyUnity.Tapjoy.GetSupportURL ( )
inlinestatic

Returns URL to Tapjoy support web page. This will use your default currency.

Deprecated
Deprecated since version 14.2.0
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.

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

◆ GetUserID()

static string TapjoyUnity.Tapjoy.GetUserID ( )
inlinestatic

Gets the identifier of the user.

Returns
the value of the identifier

◆ GetUserLevel()

static int TapjoyUnity.Tapjoy.GetUserLevel ( )
inlinestatic

Returns the level of the user.

Returns
the value of the user level

◆ 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.

◆ OnConnectFailedHandler()

delegate void TapjoyUnity.Tapjoy.OnConnectFailedHandler ( int code,
string message )

Delegate to be called when the SDK fails to connect.

Parameters
codeThe error code.
messageThe error message.

◆ OnConnectWarningHandler()

delegate void TapjoyUnity.Tapjoy.OnConnectWarningHandler ( int code,
string message )

Delegate to be called when the SDK returns a warning.

Parameters
codeThe warning code.
messageThe warning message.

◆ 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.

◆ OnSetUserIDFailedHandler()

delegate void TapjoyUnity.Tapjoy.OnSetUserIDFailedHandler ( int code,
string errorMessage )

Delegate to be called when the SDK fails to set User ID.

Parameters
codeThe code of the error
errorMessageThe message of the error

◆ OnSetUserIDFailureHandler()

delegate void TapjoyUnity.Tapjoy.OnSetUserIDFailureHandler ( string errorMessage)

Delegate to be called when the SDK fails to set User ID.

Deprecated
Deprecated since version 13.4.0

◆ 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.

◆ OptOutAdvertisingID()

static void TapjoyUnity.Tapjoy.OptOutAdvertisingID ( bool optOut)
inlinestatic

Restricts access to Google AdvertisingID.

Parameters
optOutTrue will prevent Tapjoy from accessing the devices AdvertisingID, False (default) will allow access

◆ 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

◆ SetCustomParameter()

static void TapjoyUnity.Tapjoy.SetCustomParameter ( string customParam)
inlinestatic

Assigns 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
customParamThe custom parameter to assign to this device
Returns
n/a

◆ 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

◆ SetMaxLevel()

static void TapjoyUnity.Tapjoy.SetMaxLevel ( int maxUserLevel)
inlinestatic

Sets the maximum level of the user.

Parameters
maxUserLevelthe maximum level

◆ 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

◆ TrackPurchase() [1/2]

static void TapjoyUnity.Tapjoy.TrackPurchase ( string currencyCode,
double productPrice )
inlinestatic

Tracks the purchase.

Parameters
currencyCodethe currency code of price as an alphabetic currency code specified in ISO 4217, i.e. "USD", "KRW"
productPricethe price of product

◆ TrackPurchase() [2/2]

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

Tracks the purchase.

Deprecated
Deprecated since version 14.0.0
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.

Deprecated
Deprecated since version 14.0.0
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.

Deprecated
Deprecated since version 14.0.0
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

Event Documentation

◆ OnSetUserIDFailure

OnSetUserIDFailureHandler TapjoyUnity.Tapjoy.OnSetUserIDFailure
staticaddremove

Event for OnSetUserIDFailureHandler.

Deprecated
Deprecated since version 13.4.0

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