CBAnalytics.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. //
  2. // CBAnalytics.h
  3. // Chartboost
  4. //
  5. // Copyright 2018 Chartboost. All rights reserved.
  6. //
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <StoreKit/StoreKit.h>
  10. /*!
  11. @typedef NS_ENUM (NSUInteger, CBLevelType)
  12. @abstract
  13. Used with trackLevelInfo calls to describe meta information about the level value as it
  14. pertains to the game's context.
  15. */
  16. typedef NS_ENUM(NSUInteger, CBLevelType) {
  17. /*! Highest level reached */
  18. HIGHEST_LEVEL_REACHED = 1,
  19. /*! Current area level reached */
  20. CURRENT_AREA = 2,
  21. /*! Current character level reached */
  22. CHARACTER_LEVEL = 3,
  23. /*! Other sequential level reached */
  24. OTHER_SEQUENTIAL = 4,
  25. /*! Current non sequential level reached */
  26. OTHER_NONSEQUENTIAL = 5
  27. };
  28. /*!
  29. @class ChartboostAnalytics
  30. @abstract
  31. Provide methods to track various events for improved targeting.
  32. @discussion For more information on integrating and using the Chartboost SDK
  33. please visit our help site documentation at https://help.chartboost.com
  34. */
  35. @interface CBAnalytics : NSObject
  36. /*!
  37. @abstract
  38. Track an In App Purchase Event.
  39. @param receipt The transaction receipt used to validate the purchase.
  40. @param productTitle The localized title of the product.
  41. @param productDescription The localized description of the product.
  42. @param productPrice The price of the product.
  43. @param productCurrency The localized currency of the product.
  44. @param productIdentifier The IOS identifier for the product.
  45. @discussion Tracks In App Purchases for later use with user segmentation
  46. and targeting.
  47. */
  48. + (void)trackInAppPurchaseEvent:(NSData *)receipt
  49. productTitle:(NSString *)productTitle
  50. productDescription:(NSString *)productDescription
  51. productPrice:(NSDecimalNumber *)productPrice
  52. productCurrency:(NSString *)productCurrency
  53. productIdentifier:(NSString *)productIdentifier;
  54. /*!
  55. @abstract
  56. Track an In App Purchase Event.
  57. @param receiptString The base64 encoded receipt string used to validate the purchase.
  58. @param productTitle The localized title of the product.
  59. @param productDescription The localized description of the product.
  60. @param productPrice The price of the product.
  61. @param productCurrency The localized currency of the product.
  62. @param productIdentifier The IOS identifier for the product.
  63. @discussion Tracks In App Purchases for later use with user segmentation
  64. and targeting.
  65. */
  66. + (void)trackInAppPurchaseEventWithString:(NSString *)receiptString
  67. productTitle:(NSString *)productTitle
  68. productDescription:(NSString *)productDescription
  69. productPrice:(NSDecimalNumber *)productPrice
  70. productCurrency:(NSString *)productCurrency
  71. productIdentifier:(NSString *)productIdentifier;
  72. /*!
  73. @abstract
  74. Track an In App Purchase Event.
  75. @param receipt The transaction receipt used to validate the purchase.
  76. @param product The SKProduct that was purchased.
  77. @discussion Tracks In App Purchases for later use with user segmentation
  78. and targeting.
  79. */
  80. + (void)trackInAppPurchaseEvent:(NSData *)receipt
  81. product:(SKProduct *)product;
  82. /*!
  83. @abstract
  84. Track level information about your user. Can be sequential levelling, non-sequential levelling, character level, or other.
  85. @param eventLabel A string that disambiguates the eventField. Use it to provides a human readable string to answer the question - What are we tracking ?
  86. @param eventField any value from the CBLevelType enumeration. Specifies whether this event is tracking a sequential levelling, non-sequential levelling, a character level, or other.
  87. @param mainLevel integer value to be tracked that represents the main level
  88. @param subLevel integer value to be tracked that represents the sub level, 0 if no relevant sub-level
  89. @param description A string that disambiguates the mainLevel & subLevel. Use it to provide a human readable string to answer the question - What does the mainLevel number and subLevel nubmer represent in my game ?
  90. @discussion Tracks In App Purchases for later use with user segmentation
  91. and targeting.
  92. */
  93. + (void)trackLevelInfo:(NSString*)eventLabel
  94. eventField:(CBLevelType)eventField
  95. mainLevel:(NSUInteger)mainLevel
  96. subLevel:(NSUInteger)subLevel
  97. description:(NSString*)description;
  98. /*!
  99. @abstract
  100. Track level information about your user. Can be sequential levelling, non-sequential levelling, character level, or other.
  101. @param eventLabel A string that disambiguates the eventField. Use it to provides a human readable string to answer the question - What are we tracking ?
  102. @param eventField any value from the CBLevelType enumeration. Specifies whether this event is tracking a sequential levelling, non-sequential levelling, a character level, current area, or other.
  103. @param mainLevel integer value to be tracked that represents the main level
  104. @param description A string that disambiguates the mainLevel. Use it to provide a human readable string to answer the question - What does the mainLevel number represent in my game ?
  105. @discussion Tracks In App Purchases for later use with user segmentation
  106. and targeting.
  107. */
  108. + (void)trackLevelInfo:(NSString*)eventLabel
  109. eventField:(CBLevelType)eventField
  110. mainLevel:(NSUInteger)mainLevel
  111. description:(NSString*)description;
  112. @end