15#include "jni_common.h"
16#include "TJEntryPoint.h"
21#if defined(__APPLE__) && defined(__OBJC__)
22#import <UIKit/UIKit.h>
27 class TJConnectListener;
28 class TJGetCurrencyBalanceListener;
29 class TJSpendCurrencyListener;
30 class TJAwardCurrencyListener;
31 class TJEarnedCurrencyListener;
32 class TJPlacementListener;
33 class TJSetUserIDListener;
41#if defined(ANDROID) && defined(TAPJOY_STATIC)
48 static jint setJavaVM(JavaVM* vm);
57 static void setContext(jobject context);
90 static bool connect(jobject context,
const char* sdkKey,
const std::map<const char*, const char*>& flags,
TJConnectListener* listener = NULL);
202 static void trackPurchase(
const char* productId,
const char* currencyCode,
double price,
const char* campaignId);
227#if defined(__APPLE__)
244 static void trackPurchaseInAppleAppStore(
const char* productId,
const char* currencyCode,
double price,
const char* transactionId,
const char* campaignId);
375 typedef jobject TJActionRequestHandle;
376 typedef jobject TJPlacementHandle;
377 typedef jobject TJPrivacyPolicyHandle;
379 typedef void* TJActionRequestHandle;
380 typedef void* TJPlacementHandle;
381 typedef void* TJPrivacyPolicyHandle;
388 virtual void onConnectSuccess() {}
389 virtual void onConnectFailure(
int code,
const char* error) {}
390 virtual void onConnectWarning(
int code,
const char* error) {}
397 virtual void onAwardCurrencyResponse(
const char* currencyName,
int balance) {}
398 virtual void onAwardCurrencyResponseFailure(
const char* error) {}
405 virtual void onEarnedCurrency(
const char* currencyName,
int amount) {}
412 virtual void onGetCurrencyBalanceResponse(
const char* currencyName,
int balance) {}
413 virtual void onGetCurrencyBalanceResponseFailure(
const char* error) {}
420 virtual void onSpendCurrencyResponse(
const char* currencyName,
int balance) {}
421 virtual void onSpendCurrencyResponseFailure(
const char* error) {}
428 virtual void onSetCurrencyBalanceSuccess() {}
429 virtual void onSetCurrencyBalanceFailure(
int code,
const char* error) {}
436 virtual void onSetCurrencyAmountRequiredSuccess() {}
437 virtual void onSetCurrencyAmountRequiredFailure(
int code,
const char* error) {}
444 virtual void onSetUserIDSuccess() {}
445 virtual void onSetUserIDFailure(
int code,
const char* error) {}
452 virtual void onRequestSuccess(TJPlacementHandle placementHandle,
const char* placementName) {}
453 virtual void onRequestFailure(TJPlacementHandle placementHandle,
const char* placementName,
int errorCode,
const char* errorMessage) {}
454 virtual void onContentReady(TJPlacementHandle placementHandle,
const char* placementName) {}
455 virtual void onContentShow(TJPlacementHandle placementHandle,
const char* placementName) {}
456 virtual void onContentDismiss(TJPlacementHandle placementHandle,
const char* placementName) {}
458 virtual void onClick(TJPlacementHandle placementHandle,
const char* placementName) {}
459 virtual void onPurchaseRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* productId) {}
460 virtual void onRewardRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* itemId,
int quantity) {}
465 static void completed(TJActionRequestHandle actionRequestHandle);
466 static void cancelled(TJActionRequestHandle actionRequestHandle);
472 static TJPlacementHandle create(jobject activityContext,
const char* placementName,
TJPlacementListener* listener);
475 static void release(TJPlacementHandle placementHandle);
476 static bool isContentReady(TJPlacementHandle placementHandle);
477 static bool isContentAvailable(TJPlacementHandle placementHandle);
478 static void requestContent(TJPlacementHandle placementHandle);
479 static void showContent(TJPlacementHandle placementHandle);
482 static int getCurrencyBalance(TJPlacementHandle handle,
const char* currencyId);
483 static int getCurrencyAmountRequired(TJPlacementHandle handle,
const char* currencyId);
484 static void setEntryPoint(TJPlacementHandle placementHandle, TJEntryPoint entryPoint);
485 static TJEntryPoint getEntryPoint(TJPlacementHandle placementHandle);
486#if defined(__APPLE__) && defined(__OBJC__)
487 static void showContentWithViewController(TJPlacementHandle placementHandle, UIViewController* viewController);
489 static void dismissContent();
492 enum class TJStatusCpp :
size_t {
552 static void setUSPrivacy(TJPrivacyPolicyHandle handle,
const char* privacyValue);
Definition TapjoyCpp.h:463
Definition TapjoyCpp.h:393
Definition TapjoyCpp.h:384
Definition TapjoyCpp.h:401
Definition TapjoyCpp.h:408
Definition TapjoyCpp.h:469
Definition TapjoyCpp.h:448
Definition TapjoyCpp.h:498
static void setSubjectToGDPRStatus(TJPrivacyPolicyHandle handle, TJStatusCpp gdprStatus)
This can be used by the integrating App to indicate if the user falls in any of the GDPR applicable c...
static void setUSPrivacy(TJPrivacyPolicyHandle handle, const char *privacyValue)
This is used for sending US Privacy value to behavioral advertising such as in the context of GDPR Th...
static TJPrivacyPolicyHandle getPrivacyPolicy()
Returns the TJPrivacyPolicy instance for calling methods to set GDPR, User's consent,...
static void setUserConsentStatus(TJPrivacyPolicyHandle handle, TJStatusCpp userConsentStatus)
This is used for sending User's consent to behavioral advertising such as in the context of GDPR The ...
static void setBelowConsentAgeStatus(TJPrivacyPolicyHandle handle, TJStatusCpp belowConsentAgeStatus)
In the US, the Children’s Online Privacy Protection Act (COPPA) imposes certain requirements on opera...
Definition TapjoyCpp.h:432
Definition TapjoyCpp.h:424
Definition TapjoyCpp.h:440
Definition TapjoyCpp.h:416
C++ API class of the Tapjoy SDK.
Definition TapjoyCpp.h:38
static void getCurrencyBalance(TJGetCurrencyBalanceListener *listener)
Gets the virtual currency data from the server for this device.
static void trackPurchase(const char *currencyCode, double price)
Tracks a purchase.
static const char * getLibraryName()
Returns the name of the library linked.
static const char * getUserID()
Gets the id of the user.
static void actionComplete(const char *actionID)
Informs the Tapjoy server that the specified Pay-Per-Action was completed. Should be called whenever ...
static bool connect(jobject context, const char *sdkKey, TJConnectListener *listener=NULL)
Connects to the Tapjoy Server.
static void clearUserTags()
Removes all tags from the user.
static void trackPurchaseInGooglePlayStore(const char *skuDetails, const char *purchaseData, const char *dataSignature, const char *campaignId)
Tracks a purchase with JSON data from the Google Play store. Also performs In-app Billing validation ...
static int getUserLevel()
Gets the level of the user.
static void startSession()
Manual session tracking.
static void spendCurrency(int amount, TJSpendCurrencyListener *listener)
Spends virtual currency.
static void setCustomParameter(const char *referrer)
Assign a custom parameter associated with any following placement requests that contains an ad type.
static void setUserLevel(int userLevel)
Sets the level of the user.
static const char * getCustomParameter()
Returns the currently set custom parameter.
static bool isConnected()
Helper function to check if SDK is initialized.
static bool connect(jobject context, const char *sdkKey, const std::map< const char *, const char * > &flags, TJConnectListener *listener=NULL)
Connects to the Tapjoy Server.
static void removeUserTag(const char *tag)
Removes the given tag from the user if it is present.
static void addUserTag(const char *tag)
Adds the given tag to the user if it is not already present.
static void setEarnedCurrencyListener(TJEarnedCurrencyListener *listener)
Sets the listener which gets informed whenever virtual currency is earned.
static void setUserID(const char *userID, TJSetUserIDListener *listener)
Assigns a user ID for this user/device.
static void setUserSegment(int userSegment)
Sets the segment of the user.
static int getMaxLevel()
Gets the maximum level of the user.
static const char * getVersion()
Returns the version name of the SDK.
static void setDebugEnabled(bool enable)
Enables the debug mode of the SDK.
static void awardCurrency(int amount, TJAwardCurrencyListener *listener)
Awards virtual currency.
static void trackPurchase(const char *productId, const char *currencyCode, double price, const char *campaignId)
Tracks a purchase.
static void optOutAdvertisingID(jobject context, bool optOut)
This is to opt out passing advertising_id param in the subsequent network requests.
static void setMaxLevel(int maxLevel)
Sets the maximum level of the user.
static void endSession()
Manual session tracking.
static bool connect(const char *sdkKey, const std::map< const char *, const char * > &flags, TJConnectListener *listener=NULL)
Connects to the Tapjoy Server.
static bool connect(const char *sdkKey, TJConnectListener *listener=NULL)
Connects to the Tapjoy Server.
static int getUserSegment()
Gets the segment of the user.