19 #if defined(__APPLE__) && defined(__OBJC__) 20 #import <UIKit/UIKit.h> 25 class TJConnectListener;
26 class TJGetCurrencyBalanceListener;
27 class TJSpendCurrencyListener;
28 class TJAwardCurrencyListener;
29 class TJEarnedCurrencyListener;
30 class TJVideoListener;
31 class TJPlacementListener;
39 #if defined(ANDROID) && defined(TAPJOY_STATIC) 46 static jint setJavaVM(JavaVM* vm);
55 static void setContext(jobject context);
173 static void trackPurchase(
const char* productId,
const char* currencyCode,
double price,
const char* campaignId);
195 static void trackPurchaseInGooglePlayStore(
const char* skuDetails,
const char* purchaseData,
const char* dataSignature,
const char* campaignId);
197 #if defined(__APPLE__) 213 static void trackPurchaseInAppleAppStore(
const char* productId,
const char* currencyCode,
double price,
const char* transactionId,
const char* campaignId);
229 static void trackEvent(
const char* name, int64_t value);
234 static void trackEvent(
const char* category,
const char* name, int64_t value);
239 static void trackEvent(
const char* category,
const char* name,
const char* parameter1,
const char* parameter2);
245 static void trackEvent(
const char* category,
const char* name,
const char* parameter1,
const char* parameter2, int64_t value);
251 static void trackEvent(
const char* category,
const char* name,
const char* parameter1,
const char* parameter2,
const char* valueName, int64_t value);
257 static void trackEvent(
const char* category,
const char* name,
const char* parameter1,
const char* parameter2,
const char* value1Name, int64_t value1,
const char* value2Name, int64_t value2);
260 static void trackEvent(
const char* category,
const char* name,
const char* parameter1,
const char* parameter2,
const char* value1Name, int64_t value1,
const char* value2Name, int64_t value2,
const char* value3Name, int64_t value3);
283 static void setUserID(
const char* userID);
285 #ifndef DOXYGEN_SHOULD_SKIP_THIS 293 static void setCustomParameter(
const char* referrer);
300 static const char* getCustomParameter();
416 static bool isPushNotificationDisabled();
423 static void setPushNotificationDisabled(
bool disabled);
433 static void setDeviceToken(
const char* deviceToken);
442 static void setReceiveRemoteNotification(jobject context,jobject remoteMessage);
451 static void activateInstallReferrerClient(jobject context);
460 static void setInstallReferrer(jobject context,
const char* referrer);
471 typedef jobject TJActionRequestHandle;
472 typedef jobject TJPlacementHandle;
473 typedef jobject TJPrivacyPolicyHandle;
475 typedef void* TJActionRequestHandle;
476 typedef void* TJPlacementHandle;
477 typedef void* TJPrivacyPolicyHandle;
484 virtual void onConnectSuccess() {}
485 virtual void onConnectFailure() {}
492 virtual void onAwardCurrencyResponse(
const char* currencyName,
int balance) {}
493 virtual void onAwardCurrencyResponseFailure(
const char* error) {}
500 virtual void onEarnedCurrency(
const char* currencyName,
int amount) {}
507 virtual void onGetCurrencyBalanceResponse(
const char* currencyName,
int balance) {}
508 virtual void onGetCurrencyBalanceResponseFailure(
const char* error) {}
515 virtual void onSpendCurrencyResponse(
const char* currencyName,
int balance) {}
516 virtual void onSpendCurrencyResponseFailure(
const char* error) {}
523 virtual void onVideoStart() {}
524 virtual void onVideoClose() {}
525 virtual void onVideoError(
int statusCode) {}
526 virtual void onVideoComplete() {}
533 virtual void onRequestSuccess(TJPlacementHandle placementHandle,
const char* placementName) {}
534 virtual void onRequestFailure(TJPlacementHandle placementHandle,
const char* placementName,
int errorCode,
const char* errorMessage) {}
535 virtual void onContentReady(TJPlacementHandle placementHandle,
const char* placementName) {}
536 virtual void onContentShow(TJPlacementHandle placementHandle,
const char* placementName) {}
537 virtual void onContentDismiss(TJPlacementHandle placementHandle,
const char* placementName) {}
538 virtual void onClick(TJPlacementHandle placementHandle,
const char* placementName) {}
539 virtual void onPurchaseRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* productId) {}
540 virtual void onRewardRequest(TJPlacementHandle placementHandle,
const char* placementName, TJActionRequestHandle requestHandle,
const char* requestId,
const char* requestToken,
const char* itemId,
int quantity) {}
545 static void completed(TJActionRequestHandle actionRequestHandle);
546 static void cancelled(TJActionRequestHandle actionRequestHandle);
552 static TJPlacementHandle create(jobject activityContext,
const char* placementName,
TJPlacementListener* listener);
555 static void release(TJPlacementHandle placementHandle);
556 static bool isContentReady(TJPlacementHandle placementHandle);
557 static bool isContentAvailable(TJPlacementHandle placementHandle);
558 static void requestContent(TJPlacementHandle placementHandle);
559 static void showContent(TJPlacementHandle placementHandle);
560 #if defined(__APPLE__) && defined(__OBJC__) 561 static void showContentWithViewController(TJPlacementHandle placementHandle, UIViewController* viewController);
563 static void dismissContent();
584 static void setSubjectToGDPR(TJPrivacyPolicyHandle handle,
bool gdprApplicable);
595 static void setUserConsent(TJPrivacyPolicyHandle handle,
const char* consent);
621 static void setUSPrivacy(TJPrivacyPolicyHandle handle,
const char* privacyValue);
626 #endif // TapjoyCpp_h Definition: TapjoyCpp.h:549
static void removeUserTag(const char *tag)
Removes the given tag from the user if it is present.
static const char * getLibraryName()
Returns the name of the library linked.
static void setUserConsent(TJPrivacyPolicyHandle handle, const char *consent)
Assigns a user ID for this user/device.
static void setBelowConsentAge(TJPrivacyPolicyHandle handle, bool isBelowConsentAge)
In the US, the Children’s Online Privacy Protection Act (COPPA) imposes certain requirements on oper...
static void trackEvent(const char *name)
Tracks an event of the given name without category.
Definition: TapjoyCpp.h:488
static void setAppDataVersion(const char *dataVersion)
Sets the data version of the App or Game.
static void setSubjectToGDPR(TJPrivacyPolicyHandle handle, bool gdprApplicable)
This can be used by the integrating App to indicate if the user falls in any of the GDPR applicable c...
Definition: TapjoyCpp.h:529
static void getCurrencyBalance(TJGetCurrencyBalanceListener *listener)
Gets the virtual currency data from the server for this device.
static void setUserCohortVariable(int variableIndex, const char *value)
Sets a variable of user for the cohort analysis.
static void startSession()
Manual session tracking.
static void setUserID(const char *userID)
Assigns a user ID for this user/device.
Definition: TapjoyCpp.h:566
static bool isConnected()
Helper function to check if SDK is initialized.
static const char * getVersion()
Returns the version name of the SDK.
Definition: TapjoyCpp.h:519
Definition: TapjoyCpp.h:23
static void setDebugEnabled(bool enable)
Enables the debug mode of the SDK.
Definition: TapjoyCpp.h:543
static void spendCurrency(int amount, TJSpendCurrencyListener *listener)
Spends virtual currency.
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 void addUserTag(const char *tag)
Adds the given tag to the user if it is not already present.
static bool connect(const char *sdkKey, TJConnectListener *listener=NULL)
Connects to the Tapjoy Server.
static float getCurrencyMultiplier()
Gets the multiplier for the virtual currency display.
Definition: TapjoyCpp.h:496
static void actionComplete(const char *actionID)
Informs the Tapjoy server that the specified Pay-Per-Action was completed.
static void setVideoListener(TJVideoListener *listener)
Sets the video listener.
static void trackPurchase(const char *productId, const char *currencyCode, double price, const char *campaignId)
Tracks a purchase.
static void awardCurrency(int amount, TJAwardCurrencyListener *listener)
Awards virtual currency.
static TJPrivacyPolicyHandle getPrivacyPolicy()
Returns the TJPrivacyPolicy instance for calling methods to set GDPR, User's consent, below consent age ,and US Privacy policy flags.
C++ API class of the Tapjoy SDK.
Definition: TapjoyCpp.h:36
static void endSession()
Manual session tracking.
static void setCurrencyMultiplier(float multiplier)
ONLY USE FOR NON-MANAGED (by TAPJOY) CURRENCY.
Definition: TapjoyCpp.h:511
static void setUserConsent(const char *value)
This is used for sending User's consent to behavioral advertising such as in the context of GDPR The ...
static void clearUserTags()
Removes all tags from the user.
static void setUserFriendCount(int friendCount)
Sets the friends count of the user.
static void setEarnedCurrencyListener(TJEarnedCurrencyListener *listener)
Sets the listener which gets informed whenever virtual currency is earned.
static void belowConsentAge(bool isBelowConsentAge)
In the US, the Children’s Online Privacy Protection Act (COPPA) imposes certain requirements on oper...
static void setUserLevel(int userLevel)
Sets the level of the user.
Definition: TapjoyCpp.h:480
Definition: TapjoyCpp.h:503
static void subjectToGDPR(bool gdprApplicable)
This can be used by the integrating App to indicate if the user falls in any of the GDPR applicable c...