Tapjoy Class Reference

Inherits from NSObject
Declared in Tapjoy.h

Overview

The Tapjoy Connect Main class. This class provides all publicly available methods for developers to integrate Tapjoy into their applications.

Other Methods

  sdkKey

The application SDK key unique to this app.

@property (nullable, nonatomic, copy) NSString *sdkKey

Discussion

The application SDK key unique to this app.

Declared In

Tapjoy.h

  appID

The application ID unique to this app.

@property (nullable, nonatomic, copy) NSString *appID

Discussion

The application ID unique to this app.

Declared In

Tapjoy.h

  secretKey

The Tapjoy secret key for this applicaiton.

@property (nullable, nonatomic, copy) NSString *secretKey

Discussion

The Tapjoy secret key for this applicaiton.

Declared In

Tapjoy.h

  )

The user ID, a custom ID set by the developer of an app to keep track of its unique users.

@property (nullable, nonatomic, readonly) NSString *TJC_DEPRECATION_WARNING ( 14.0 .0 )

Discussion

The user ID, a custom ID set by the developer of an app to keep track of its unique users.

Declared In

Tapjoy.h

  plugin

The name of the plugin used. If no plugin is used, this value is set to “native” by default.

@property (nullable, nonatomic, copy) NSString *plugin

Discussion

The name of the plugin used. If no plugin is used, this value is set to “native” by default.

Declared In

Tapjoy.h

  status

Indicates Tapjoy SDK’s connect status

@property (nonatomic, assign, readonly) TJSdkStatus status

Discussion

Indicates Tapjoy SDK’s connect status

Declared In

Tapjoy.h

+ connect:

This method is called to initialize the Tapjoy system and notify the server that this device is running your application.

+ (void)connect:(NSString *)sdkKey

Parameters

sdkKey

The application SDK Key. Retrieved from the app dashboard in your Tapjoy account.

Discussion

This method is called to initialize the Tapjoy system and notify the server that this device is running your application.

This method should be called upon app delegate initialization in the applicationDidFinishLaunching method.

You can use the notification names TJC_CONNECT_SUCCESS and TJC_CONNECT_FAILED with NSNotificationCenter. This allows you to receive notifications when Tapjoy successfully connects or fails to connect.

Declared In

Tapjoy.h

+ connect:options:

This method is called to initialize the Tapjoy system and notify the server that this device is running your application.

+ (void)connect:(NSString *)sdkKey options:(nullable NSDictionary *)options

Parameters

sdkKey

The application SDK Key. Retrieved from the app dashboard in your Tapjoy account.

options

NSDictionary of special flags to enable non-standard settings. Valid key:value options:

TJC_OPTION_ENABLE_LOGGING : BOOL to enable logging

TJC_OPTION_USER_ID : NSString user id that must be set if your currency is not managed by Tapjoy. If you don’t have a user id on launch you can call setUserID later

TJC_OPTION_DISABLE_GENERIC_ERROR_ALERT : BOOL to disable our default error dialogs

Discussion

This method is called to initialize the Tapjoy system and notify the server that this device is running your application.

This method should be called upon app delegate initialization in the applicationDidFinishLaunching method.

You can use the notification names TJC_CONNECT_SUCCESS and TJC_CONNECT_FAILED with NSNotificationCenter. This allows you to receive notifications when Tapjoy successfully connects or fails to connect.

Declared In

Tapjoy.h

+ isConnected

Helper function to check if SDK is initialized

+ (BOOL)isConnected

Discussion

Helper function to check if SDK is initialized

Declared In

Tapjoy.h

+ getSupportURL

Deprecated since 14.2.0 This method returns URL to Tapjoy support web page. This will use your default currency.

+ (nullable NSString *)getSupportURL

Return Value

URL of Tapjoy support web page

Discussion

Deprecated since 14.2.0 This method returns URL to Tapjoy support web page. This will use your default currency.

Declared In

Tapjoy.h

+ getSupportURL:

Deprecated since 14.2.0 This method returns the URL to Tapjoy support web page for specified currency You can get your currencyID from the Tapjoy Dashboard under the currency section.

+ (nullable NSString *)getSupportURL:(nullable NSString *)currencyID

Parameters

currencyID

the app’s currency id

Return Value

URL of Tapjoy support web page for specified currency

Discussion

Deprecated since 14.2.0 This method returns the URL to Tapjoy support web page for specified currency You can get your currencyID from the Tapjoy Dashboard under the currency section.

Declared In

Tapjoy.h

+ setDebugEnabled:

This method enables/disables the debug mode of the SDK.

+ (void)setDebugEnabled:(BOOL)enabled

Parameters

enabled

true to enable, false to disable

Discussion

This method enables/disables the debug mode of the SDK.

Declared In

Tapjoy.h

+ startSession

This method is called to track the session manually. If this method called, automatic session tracking will be disabled.

+ (void)startSession

Discussion

This method is called to track the session manually. If this method called, automatic session tracking will be disabled.

Declared In

Tapjoy.h

+ endSession

This method is called to track the session manually. If this method called, automatic session tracking will be disabled.

+ (void)endSession

Discussion

This method is called to track the session manually. If this method called, automatic session tracking will be disabled.

Declared In

Tapjoy.h

+ getPrivacyPolicy

Returns the TJPrivacyPolicy instance for calling methods to set GDPR, User’s consent, below consent age ,and US Privacy policy flags

+ (TJPrivacyPolicy *)getPrivacyPolicy

Return Value

The globally accessible TJPrivacyPolicy singleton object.

Discussion

Returns the TJPrivacyPolicy instance for calling methods to set GDPR, User’s consent, below consent age ,and US Privacy policy flags

Declared In

Tapjoy.h

+ setDefaultViewController:

Sets the default UIViewController to show a content of the placement having no specific view controller given.

+ (void)setDefaultViewController:(nullable UIViewController *)viewController

Discussion

Sets the default UIViewController to show a content of the placement having no specific view controller given.

Warning: This is experimental and only applicable to contents of the default placements.

Declared In

Tapjoy.h

+ setUserLevel:

This method is called to set the level of the user.

+ (void)setUserLevel:(int)userLevel

Discussion

This method is called to set the level of the user.

@param userLevel the level of the user

Declared In

Tapjoy.h

+ getUserLevel

This method retrieves user’s level

+ (int)getUserLevel

Return Value

userLevel

Discussion

This method retrieves user’s level

Declared In

Tapjoy.h

+ setMaxLevel:

This method sets the maximum level.

+ (void)setMaxLevel:(int)maxLevel

Discussion

This method sets the maximum level.

@param maxLevel the maximum possible level.

Declared In

Tapjoy.h

+ getMaxLevel

This method retrieves the maximum possible level

+ (NSNumber *)getMaxLevel

Return Value

maxLevel

Discussion

This method retrieves the maximum possible level

Declared In

Tapjoy.h

+ getUserTags

Returns a string set which contains tags on the user.

+ (nullable NSSet *)getUserTags

Return Value

set of string

Discussion

Returns a string set which contains tags on the user.

Declared In

Tapjoy.h

+ setUserTags:

Sets tags for the user.

+ (void)setUserTags:(nullable NSSet *)tags

Parameters

tags

the tags to be set can have up to 200 tags where each tag can have 200 characters

Discussion

Sets tags for the user.

Declared In

Tapjoy.h

+ clearUserTags

Removes all tags from the user.

+ (void)clearUserTags

Discussion

Removes all tags from the user.

Declared In

Tapjoy.h

+ addUserTag:

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

+ (void)addUserTag:(NSString *)tag

Parameters

tag

the tag to be added

Discussion

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

Declared In

Tapjoy.h

+ removeUserTag:

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

+ (void)removeUserTag:(NSString *)tag

Parameters

tag

the tag to be removed

Discussion

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

Declared In

Tapjoy.h

+ trackPurchaseWithCurrencyCode:price:

This method is called to track the purchase.

+ (void)trackPurchaseWithCurrencyCode:(NSString *)currencyCode price:(double)price

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

Discussion

This method is called to track the purchase.

Declared In

Tapjoy.h

+ trackPurchase:currencyCode:price:campaignId:transactionId:

Deprecated since 14.0.0 This method is called to track the purchase.

+ (void)trackPurchase:(nullable NSString *)productIdentifier currencyCode:(nullable NSString *)currencyCode price:(double)price campaignId:(nullable NSString *)campaignId transactionId:(nullable NSString *)transactionId

Parameters

productIdentifier

the identifier of product

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 the purchase request which initiated this purchase, can be nil

transactionId

the identifier of iap transaction, if this is given, we will check receipt validation. (Available in iOS 7.0 and later)

Discussion

Deprecated since 14.0.0 This method is called to track the purchase.

Declared In

Tapjoy.h

+ actionComplete:

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.

+ (void)actionComplete:(NSString *)actionID

Parameters

actionID

The action ID of the completed action

Discussion

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.

Declared In

Tapjoy.h

+ sharedTapjoyConnect

Retrieves the globally accessible Tapjoy singleton object.

+ (instancetype)sharedTapjoyConnect

Return Value

The globally accessible Tapjoy singleton object.

Discussion

Retrieves the globally accessible Tapjoy singleton object.

Declared In

Tapjoy.h

+ getUserID

The user ID, a custom ID set by the developer of an app to keep track of its unique users.

+ (NSString *_Nullable)getUserID

Return Value

The user ID assigned to this device.

Discussion

The user ID, a custom ID set by the developer of an app to keep track of its unique users.

Declared In

Tapjoy.h

+ setUserIDWithCompletion:completion:

Assigns a user ID for this user/device. This is used to identify the user in your application

+ (void)setUserIDWithCompletion:(nullable NSString *)theUserID completion:(nullable networkCompletion)completion

Parameters

theUserID

The user ID you wish to assign to this device.

completion

The completion block that is invoked after a response is received from the server.

Discussion

Assigns a user ID for this user/device. This is used to identify the user in your application

Declared In

Tapjoy.h

+ setCustomParameter:

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.

+ (void)setCustomParameter:(nullable NSString *)customParam

Parameters

customParam

The custom parameter to assign to this device

Discussion

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.

Declared In

Tapjoy.h

+ getCustomParameter

Returns the currently set custom parameter.

+ (nullable NSString *)getCustomParameter

Return Value

the value of the currently set custom parameter

Discussion

Returns the currently set custom parameter.

Declared In

Tapjoy.h

+ enableLogging:

Toggle logging to the console.

+ (void)enableLogging:(BOOL)enable

Parameters

enable

YES to enable logging, NO otherwise.

Discussion

Toggle logging to the console.

Declared In

Tapjoy.h

+ getVersion

Returns the SDK version.

+ (NSString *)getVersion

Return Value

The Tapjoy SDK version.

Discussion

Returns the SDK version.

Declared In

Tapjoy.h

+ setUserSegment:

Sets the segment of the user

+ (void)setUserSegment:(TJSegment)userSegment

Parameters

userSegment

TJSegment enum 0 (non-payer), 1 (payer), 2 (VIP), -1 (unknown)

Discussion

Sets the segment of the user

Declared In

Tapjoy.h

+ getUserSegment

Gets the segment of the user

+ (TJSegment)getUserSegment

Return Value

TJSegment enum 0 (non-payer), 1 (payer), 2 (VIP), -1 (unknown).

Discussion

Gets the segment of the user

Declared In

Tapjoy.h

TJCCurrencyManager Methods

+ getCurrencyBalance

Requests for virtual currency balance notify via TJC_GET_CURRENCY_RESPONSE_NOTIFICATION notification.

+ (void)getCurrencyBalance

Discussion

Requests for virtual currency balance notify via TJC_GET_CURRENCY_RESPONSE_NOTIFICATION notification.

Declared In

Tapjoy.h

+ getCurrencyBalanceWithCompletion:

Requests for virtual currency balance information.

+ (void)getCurrencyBalanceWithCompletion:(nullable currencyCompletion)completion

Parameters

completion

The completion block that is invoked after a response is received from the server.

Discussion

Requests for virtual currency balance information.

Declared In

Tapjoy.h

+ spendCurrency:

Updates the virtual currency for the user with the given spent amount of currency.

+ (void)spendCurrency:(int)amount

Parameters

amount

The amount of currency to subtract from the current total amount of currency the user has.

Discussion

Updates the virtual currency for the user with the given spent amount of currency.

If the spent amount exceeds the current amount of currency the user has, nothing will happen.

Declared In

Tapjoy.h

+ spendCurrency:completion:

Updates the virtual currency for the user with the given spent amount of currency.

+ (void)spendCurrency:(int)amount completion:(nullable currencyCompletion)completion

Parameters

amount

The amount of currency to subtract from the current total amount of currency the user has.

completion

The completion block that is invoked after a response is received from the server.

Discussion

Updates the virtual currency for the user with the given spent amount of currency.

If the spent amount exceeds the current amount of currency the user has, nothing will happen.

Declared In

Tapjoy.h

+ awardCurrency:

Updates the virtual currency for the user with the given awarded amount of currency.

+ (void)awardCurrency:(int)amount

Parameters

amount

The amount of currency to add to the current total amount of currency the user has.

Discussion

Updates the virtual currency for the user with the given awarded amount of currency.

Declared In

Tapjoy.h

+ awardCurrency:completion:

Updates the virtual currency for the user with the given awarded amount of currency.

+ (void)awardCurrency:(int)amount completion:(nullable currencyCompletion)completion

Parameters

amount

The amount of currency to add to the current total amount of currency the user has.

completion

The completion block that is invoked after a response is received from the server.

Discussion

Updates the virtual currency for the user with the given awarded amount of currency.

Declared In

Tapjoy.h

+ showDefaultEarnedCurrencyAlert

Shows a UIAlert that tells the user how much currency they just earned.

+ (void)showDefaultEarnedCurrencyAlert

Discussion

Shows a UIAlert that tells the user how much currency they just earned.

Declared In

Tapjoy.h