CBInPlay.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * CBInPlay.h
  3. * Chartboost
  4. * 7.3.0
  5. *
  6. * Copyright 2018 Chartboost. All rights reserved.
  7. */
  8. #import "Chartboost.h"
  9. /*! @abstract CBInPlay forward declaration. */
  10. @class CBInPlay;
  11. /*!
  12. @class Chartboost
  13. @abstract
  14. Provide methods to display and controler Chartboost native advertising types.
  15. This is a category extension that adds additional functionality to the Chartboost object.
  16. @discussion For more information on integrating and using the Chartboost SDK
  17. please visit our help site documentation at https://help.chartboost.com
  18. */
  19. @interface Chartboost (CBInPlay)
  20. /*!
  21. @abstract
  22. Cache a number of InPlay objects for the given CBLocation.
  23. @param location The location for the Chartboost impression type.
  24. @discussion This method will first check if there is a locally cached InPlay object set
  25. for the given CBLocation and, if found, will do nothing. If no locally cached data exists
  26. the method will attempt to fetch data from the Chartboost API server.
  27. */
  28. + (void)cacheInPlay:(CBLocation)location;
  29. /*!
  30. @abstract
  31. Determine if a locally cached InPlay object exists for the given CBLocation.
  32. @param location The location for the Chartboost impression type.
  33. @return YES if there a locally cached InPlay object, and NO if not.
  34. @discussion A return value of YES here indicates that the corresponding
  35. getInPlay:(CBLocation)location method will return an InPlay object without making
  36. additional Chartboost API server requests to fetch data to present.
  37. */
  38. + (BOOL)hasInPlay:(CBLocation)location;
  39. /*!
  40. @abstract
  41. Return an InPlay object for the given CBLocation.
  42. @param location The location for the Chartboost impression type.
  43. @return CBInPlay object if one exists in the InPlay cache or nil if one is not yet available.
  44. @discussion This method will first check if there is a locally cached InPlay object
  45. for the given CBLocation and, if found, will return the object using the locally cached data.
  46. If no locally cached data exists the method will attempt to fetch data from the
  47. Chartboost API server. If the Chartboost API server is unavailable
  48. or there is no eligible InPlay object to present in the given CBLocation this method
  49. is a no-op.
  50. */
  51. + (CBInPlay *)getInPlay:(CBLocation)location;
  52. @end
  53. /*!
  54. @class CBInPlay
  55. @abstract
  56. CBInPlay ad type is a native ad type that is left the end user to integrate into their
  57. applications own custom experiences. Chartboost acts as a data marshalling system
  58. and gives the developer access to specific attributes of the ad type.
  59. @discussion For more information on integrating and using the Chartboost SDK
  60. please visit our help site documentation at https://help.chartboost.com
  61. */
  62. @interface CBInPlay : NSObject
  63. /*! @abstract CBLocation target for the CBInPlay ad. */
  64. @property (nonatomic, strong, readonly) CBLocation location;
  65. /*! @abstract Image byte data for the CBInPlay icon. */
  66. @property (nonatomic, strong, readonly) NSData *appIcon;
  67. /*! @abstract Application name associated with the ad. */
  68. @property (nonatomic, strong, readonly) NSString *appName;
  69. /*!
  70. @abstract
  71. Marks the CBInPlay object as shown and notifies the Charboost API servers.
  72. @discussion This method will emit a server request to the Chartboost API servers
  73. to mark the CBInPlay ad as viewed. You must send this information to correlate
  74. with installs driven by the ad.
  75. */
  76. - (void)show;
  77. /*!
  78. @abstract
  79. Marks the CBInPlay object as clicked and notifies the Charboost API servers.
  80. @discussion This method will emit a server request to the Chartboost API servers
  81. to mark the CBInPlay ad as clicked. You must send this information to correlate
  82. with installs driven by the ad.
  83. */
  84. - (void)click;
  85. /*!
  86. @abstract
  87. Clears all CBInPlay objects from the cache locations.
  88. @discussion This method will clear all the CBInPlay native ads from the internal cash.
  89. This is intended to be used to either force an update for all content or reduce the
  90. memory overhead of this feature.
  91. */
  92. - (void)clearCache;
  93. @end