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);
209 static void trackPurchase(
const char* productId,
const char* currencyCode,
double price,
const char* campaignId);
234#if defined(__APPLE__)
251 static void trackPurchaseInAppleAppStore(
const char* productId,
const char* currencyCode,
double price,
const char* transactionId,
const char* campaignId);
382 typedef jobject TJActionRequestHandle;
383 typedef jobject TJPlacementHandle;
384 typedef jobject TJPrivacyPolicyHandle;
386 typedef void* TJActionRequestHandle;
387 typedef void* TJPlacementHandle;
388 typedef void* TJPrivacyPolicyHandle;
395 virtual void onConnectSuccess() {}
396 virtual void onConnectFailure(
int code,
const char* error) {}
397 virtual void onConnectWarning(
int code,
const char* error) {}
404 virtual void onAwardCurrencyResponse(
const char* currencyName,
int balance) {}
405 virtual void onAwardCurrencyResponseFailure(
const char* error) {}
412 virtual void onEarnedCurrency(
const char* currencyName,
int amount) {}
419 virtual void onGetCurrencyBalanceResponse(
const char* currencyName,
int balance) {}
420 virtual void onGetCurrencyBalanceResponseFailure(
const char* error) {}
427 virtual void onSpendCurrencyResponse(
const char* currencyName,
int balance) {}
428 virtual void onSpendCurrencyResponseFailure(
const char* error) {}
435 virtual void onSetCurrencyBalanceSuccess() {}
436 virtual void onSetCurrencyBalanceFailure(
int code,
const char* error) {}
443 virtual void onSetCurrencyAmountRequiredSuccess() {}
444 virtual void onSetCurrencyAmountRequiredFailure(
int code,
const char* error) {}
451 virtual void onSetUserIDSuccess() {}
452 virtual void onSetUserIDFailure(
int code,
const char* error) {}
459 virtual void onRequestSuccess(TJPlacementHandle placementHandle,
const char* placementName) {}
460 virtual void onRequestFailure(TJPlacementHandle placementHandle,
const char* placementName,
int errorCode,
const char* errorMessage) {}
461 virtual void onContentReady(TJPlacementHandle placementHandle,
const char* placementName) {}
462 virtual void onContentShow(TJPlacementHandle placementHandle,
const char* placementName) {}
463 virtual void onContentDismiss(TJPlacementHandle placementHandle,
const char* placementName) {}
465 virtual void onClick(TJPlacementHandle placementHandle,
const char* placementName) {}
466 virtual void onPurchaseRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* productId) {}
467 virtual void onRewardRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* itemId,
int quantity) {}
472 static void completed(TJActionRequestHandle actionRequestHandle);
473 static void cancelled(TJActionRequestHandle actionRequestHandle);
479 static TJPlacementHandle create(jobject activityContext,
const char* placementName,
TJPlacementListener* listener);
482 static void release(TJPlacementHandle placementHandle);
483 static bool isContentReady(TJPlacementHandle placementHandle);
484 static bool isContentAvailable(TJPlacementHandle placementHandle);
485 static void requestContent(TJPlacementHandle placementHandle);
486 static void showContent(TJPlacementHandle placementHandle);
489 static int getCurrencyBalance(TJPlacementHandle handle,
const char* currencyId);
490 static int getCurrencyAmountRequired(TJPlacementHandle handle,
const char* currencyId);
491 static void setEntryPoint(TJPlacementHandle placementHandle, TJEntryPoint entryPoint);
492 static TJEntryPoint getEntryPoint(TJPlacementHandle placementHandle);
493#if defined(__APPLE__) && defined(__OBJC__)
494 static void showContentWithViewController(TJPlacementHandle placementHandle, UIViewController* viewController);
496 static void dismissContent();
499 enum class TJStatusCpp :
size_t {
559 static void setUSPrivacy(TJPrivacyPolicyHandle handle,
const char* privacyValue);
Definition TapjoyCpp.h:470
Definition TapjoyCpp.h:400
Definition TapjoyCpp.h:391
Definition TapjoyCpp.h:408
Definition TapjoyCpp.h:415
Definition TapjoyCpp.h:476
Definition TapjoyCpp.h:455
Definition TapjoyCpp.h:505
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:439
Definition TapjoyCpp.h:431
Definition TapjoyCpp.h:447
Definition TapjoyCpp.h:423
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 bool getOptOutAdvertisingID(jobject context)
Returns the currently set opt out advertising_id value.
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.