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

  userID

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

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

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

  currencyMultiplier

The currency multiplier value, used to adjust currency earned.

@property (nonatomic, assign) float currencyMultiplier

Discussion

The currency multiplier value, used to adjust currency earned.

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.

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.

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

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

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

Declared In

Tapjoy.h

+ getSupportURL:

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

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

+ getUserToken

This method returns a user token for programmatic mediation.

+ (nullable NSString *)getUserToken

Discussion

This method returns a user token for programmatic mediation.

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

+ setAppDataVersion:

This method is called to set data version of your application.

+ (void)setAppDataVersion:(nullable NSString *)appDataVersion

Parameters

appDataVersion

The application data version.

Discussion

This method is called to set data version of your application.

Declared In

Tapjoy.h

+ setApplicationLaunchingOptions:

This method is called to set LaunchOptions. Call this method in application:didFinishLaunchingWithOptions: NOTE: From 11.2.2, you don’t have to call this method.

+ (void)setApplicationLaunchingOptions:(nullable NSDictionary *)launchOptions

Parameters

launchOptions

the same parameter that passed on application:didFinishLaunchingWithOptions:

Discussion

This method is called to set LaunchOptions. Call this method in application:didFinishLaunchingWithOptions: NOTE: From 11.2.2, you don’t have to call this method.

Declared In

Tapjoy.h

+ setReceiveRemoteNotification:

This method is called to set RemoteNotificationUserInfo. Call this method in application:didReceiveRemoteNotification:

+ (void)setReceiveRemoteNotification:(nullable NSDictionary *)userInfo

Parameters

userInfo

the same parameter that passed on application:didReceiveRemoteNotification:

Discussion

This method is called to set RemoteNotificationUserInfo. Call this method in application:didReceiveRemoteNotification:

Declared In

Tapjoy.h

+ setDeviceToken:

This method is called to send APN device token to Tapjoy server.

+ (void)setDeviceToken:(nullable NSData *)deviceToken

Parameters

deviceToken

the same parameter that passed on application:didRegisterForRemoteNotificationsWithDeviceToken:

Discussion

This method is called to send APN device token to Tapjoy server.

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 “Push to Earn” or the default placements so far.

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

+ setUserFriendCount:

This method is callled to sets the friends count of the user.

+ (void)setUserFriendCount:(int)friendCount

Parameters

friendCount

the number of friends

Discussion

This method is callled to sets the friends count of the user.

Declared In

Tapjoy.h

+ setUserCohortVariable:value:

This method is called to set a variable of the cohort.

+ (void)setUserCohortVariable:(int)index value:(nullable NSString *)value

Parameters

index

the index of the cohort to set (1,2,3,4,5)

value

the value of the property to set

Discussion

This method is called to set a variable of the cohort.

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

+ trackPurchase:currencyCode:price:campaignId:transactionId:

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

This method is called to track the purchase.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:value:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2 value:(int64_t)value

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

value

the value of event

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:value1name:value1:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2 value1name:(nullable NSString *)value1name value1:(int64_t)value1

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

value1name

the name of value1 of event

value1

the value of value1name

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:value1name:value1:value2name:value2:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2 value1name:(nullable NSString *)value1name value1:(int64_t)value1 value2name:(nullable NSString *)value2name value2:(int64_t)value2

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

value1name

the name of value1 of event

value1

the value of value1name

value2name

the name of value2 of event

value2

the value of value2name

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:value1name:value1:value2name:value2:value3name:value3:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2 value1name:(nullable NSString *)value1name value1:(int64_t)value1 value2name:(nullable NSString *)value2name value2:(int64_t)value2 value3name:(nullable NSString *)value3name value3:(int64_t)value3

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

value1name

the name of value1 of event

value1

the value of value1name

value2name

the name of value2 of event

value2

the value of value2name

value3name

the name of value3 of event

value3

the value of value3name

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ trackEvent:category:parameter1:parameter2:values:

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

+ (void)trackEvent:(NSString *)name category:(nullable NSString *)category parameter1:(nullable NSString *)parameter1 parameter2:(nullable NSString *)parameter2 values:(nullable NSDictionary *)values

Parameters

name

the name of event

category

the category of event, can be nil

parameter1

the parameter of event, string type, can be nil

parameter2

the parameter of event, string type, can be nil

values

the dictionary of values

Discussion

This method is called to track an event of the given name with category, parameter1, parameter2 and values.

Declared In

Tapjoy.h

+ actionComplete:

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

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

+ setUserID:

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

+ (void)setUserID:(nullable NSString *)theUserID

Parameters

theUserID

The user ID you wish to assign to this device.

Discussion

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

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

+ setCurrencyMultiplier:

Sets the currency multiplier for virtual currency to be earned. The default is 1.0.

+ (void)setCurrencyMultiplier:(float)mult

Parameters

mult

The currency multiplier.

Discussion

Sets the currency multiplier for virtual currency to be earned. The default is 1.0.

Only used for non-managed (by Tapjoy) currency.

Declared In

Tapjoy.h

+ getCurrencyMultiplier

Gets the currency multiplier for virtual currency to be earned.

+ (float)getCurrencyMultiplier

Return Value

The currency multiplier value.

Discussion

Gets the currency multiplier for virtual currency to be earned.

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

  limitedSdkKey

Used by limited SDK only *

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

Discussion

Used by limited SDK only *

Declared In

Tapjoy.h

TJCVideoManager Methods

+ setVideoAdDelegate:

Sets the class that implements the TJCVideoAdDelegate protocol.

+ (void)setVideoAdDelegate:(nullable id<TJCVideoAdDelegate>)delegate

Parameters

delegate

The class that implements the TJCVideoAdDelegate protocol.

Discussion

Sets the class that implements the TJCVideoAdDelegate protocol.

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

+ setUserConsent:

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

+ (void)setUserConsent:(NSString *)value

Parameters

value

“0” (User has not provided consent), “1” (User has provided consent) or a daisybit string as suggested in IAB’s Transparency and Consent Framework

Discussion

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

Declared In

Tapjoy.h

+ subjectToGDPR:

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 YES when User (Subject) is applicable to GDPR regulations and NO when User is not applicable to GDPR regulations. In the absence of this call, Tapjoy server makes the determination of GDPR applicability.

+ (void)subjectToGDPR:(BOOL)gdprApplicability

Parameters

gdprApplicability

YES if the user is affected by GDPR, NO if they are not.

Discussion

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 YES when User (Subject) is applicable to GDPR regulations and NO when User is not applicable to GDPR regulations. In the absence of this call, Tapjoy server makes the determination of GDPR applicability.

Declared In

Tapjoy.h

+ belowConsentAge:

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.

+ (void)belowConsentAge:(BOOL)isBelowConsentAge

Parameters

isBelowConsentAge

YES if the user is affected by COPPA, NO if they are not.

Discussion

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.

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