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 ActionComplete (string actionID)
 Informs the Tapjoy server that the specified Pay-Per-Action was completed. More...
 
static void EnablePaidAppWithActionID (String paidAppWithActionID)
 Enables a paid app Pay-Per-Action. 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 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 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

§ 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 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

§ EnablePaidAppWithActionID()

static void TapjoyUnity.Tapjoy.EnablePaidAppWithActionID ( String  paidAppWithActionID)
inlinestatic

Enables a paid app Pay-Per-Action.

ONLY USE FOR PAID APP INSTALLS. This method should be called after SDK is connected.

Must enable a paid app Pay-Per-Action on the Tapjoy dashboard. Starts a 15 minute timer. After which, will send an actionComplete call with the paid app PPA to inform the Tapjoy server that the paid install PPA has been completed.

Parameters
paidAppWithActionIDThe Pay-Per-Action ID for this paid app download action.

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

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

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

§ 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

§ 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

§ 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

§ 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: