FlurryAdDelegate.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. //
  2. // FlurryAdDelegate.h
  3. // Flurry
  4. //
  5. // Copyright 2010 - 2013 Flurry, Inc. All rights reserved.
  6. //
  7. // Methods in this header file are for use with Flurry
  8. //
  9. #import <UIKit/UIKit.h>
  10. typedef enum {
  11. WEB_BANNER = 1,
  12. WEB_TAKEOVER = 2,
  13. VIDEO_TAKEOVER = 3,
  14. AD_BANNER = 4,
  15. AD_TAKEOVER = 5,
  16. NETWORK_BANNER = 6,
  17. NETWORK_TAKEOVER = 7
  18. } FlurryAdType;
  19. /*!
  20. * @brief Provides all available delegates for receiving callbacks related to Ad Serving.
  21. *
  22. * Set of methods that allow developers to manage and take actions within
  23. * different phases of App ad display.
  24. *
  25. * @note This class serves as a delegate for FlurryAds. \n
  26. * For additional information on how to use Flurry's Ads SDK to
  27. * attract high-quality users and monetize your user base see <a href="http://wiki.flurry.com/index.php?title=Publisher">Support Center - Publisher</a>.
  28. * @author 2010 - 2013 Flurry, Inc. All Rights Reserved.
  29. * @version 4.3.0
  30. *
  31. */
  32. @protocol FlurryAdDelegate <NSObject>
  33. @optional
  34. /*!
  35. * @brief Invoked when an ad is received for the specified @c adSpace.
  36. * @since 4.1
  37. *
  38. * This method informs the app that an ad has been received and is available for display.
  39. *
  40. * @see FlurryAds#fetchAdForSpace:frame:size: for details on the method that will invoke this delegate.
  41. *
  42. * @param adSpace The placement of an ad in your app, where placement may
  43. * be splash screen for SPLASH_AD.
  44. */
  45. - (void) spaceDidReceiveAd:(NSString*)adSpace;
  46. /*!
  47. * @brief Invoked when an ad can not be retrieved for the specified @c adSpace.
  48. * @since 4.1
  49. *
  50. * This method informs the app that an ad has failed to be received for the given adSpace.
  51. *
  52. * @see FlurryAds#fetchAdForSpace:frame:size: for details on the method that will invoke this delegate.
  53. *
  54. * @param adSpace The placement of an ad in your app, where placement may
  55. * @param error The error, if known, that caused ads not to be received.
  56. * be splash screen for SPLASH_AD.
  57. */
  58. - (void) spaceDidFailToReceiveAd:(NSString*)adSpace error:(NSError *)error;
  59. /*!
  60. * @brief Invoked when an ad is about to display on the specified @c adSpace.
  61. * @since 4.1.0
  62. *
  63. * This method informs the app that an ad is about to be displayed. You can decide at this point not to show this ad by simply returning NO.
  64. *
  65. * @see FlurryAds#displayAdForSpace:view: for details on the method that will invoke this delegate. \n
  66. * FlurryAds#fetchAndDisplayAdForSpace:view:size: for details on the method that will invoke this delegate.
  67. *
  68. * @param adSpace The placement of an ad in your app, where placement may
  69. * be splash screen for SPLASH_AD.
  70. * @param interstitial YES/NO if the space to display will be an interstitial.
  71. */
  72. - (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial;
  73. /*!
  74. * @brief [Deprecated] This method is deprecated. -[spaceShouldDisplay:interstitial:] should be used.
  75. */
  76. - (BOOL)spaceShouldDisplay:(NSString*)adSpace forType:(FlurryAdType)type __attribute__ ((deprecated));
  77. /*!
  78. * @brief Invoked when an ad fails to render.
  79. * @since 4.0.0
  80. *
  81. * This method informs the user an ad was retrieved, however, was unsuccessful in displaying to the user (could be lost network connectivity for example).
  82. *
  83. * @see FlurryAds#displayAdForSpace:view: for details on the method that will invoke this delegate. \n
  84. * FlurryAds#fetchAndDisplayAdForSpace:view:size: for details on the method that will invoke this delegate.
  85. *
  86. * @param adSpace The placement of an ad in your app, where placement may
  87. * @param error The error, if known, that caused ads not to be rendered.
  88. * be splash screen for SPLASH_AD.
  89. */
  90. - (void) spaceDidFailToRender:(NSString *)space error:(NSError *)error;
  91. /*!
  92. * @brief Invoked when the ad will be removed.
  93. * @since 4.1
  94. *
  95. * This method informs the app that an ad will be removed.
  96. *
  97. * @param adSpace The placement of an ad in your app, where placement may be splash screen for SPLASH_AD.
  98. * @param interstitial YES/NO indicates if space being removed is an interstitial
  99. *
  100. */
  101. - (void)spaceWillDismiss:(NSString *)adSpace interstitial:(BOOL)interstitial;
  102. /*!
  103. * @brief Invoked when the ad has been removed.
  104. * @since 4.0.0
  105. *
  106. * This method informs the app that an ad has closed. You can use this to resume app
  107. * states.
  108. *
  109. * @param adSpace The placement of an ad in your app, where placement may
  110. * be splash screen for SPLASH_AD.
  111. * @param interstitial YES/NO indicates if space being removed is an interstitial
  112. */
  113. - (void)spaceDidDismiss:(NSString *)adSpace interstitial:(BOOL)interstitial;
  114. /*!
  115. * @brief Invoked when the ad has been selected that will take the user out of the app.
  116. * @since 4.0.0
  117. *
  118. * This method informs the app that an ad has been clicked and the user is about to be taken outside the app.
  119. *
  120. * @param adSpace The placement of an ad in your app, where placement may
  121. * be splash screen for SPLASH_AD.
  122. */
  123. - (void)spaceWillLeaveApplication:(NSString *)adSpace;
  124. /*!
  125. * @brief Invoked when a space will be expanded.
  126. * @since 4.1
  127. *
  128. * This method informs the app an ad space (typcially a banner) will be expanded. Apps should pause their state when they receive this notification
  129. *
  130. * @param adSpace The placement of an ad in your app, where placement may
  131. * be splash screen for SPLASH_AD.
  132. */
  133. - (void) spaceWillExpand:(NSString *)adSpace;
  134. /*!
  135. * @brief Invoked when a space will be collapsed.
  136. * @since 4.1
  137. *
  138. * This method informs the app an ad space (typcially a banner) will be collapsed.
  139. *
  140. * @param adSpace The placement of an ad in your app, where placement may
  141. * be splash screen for SPLASH_AD.
  142. */
  143. - (void) spaceWillCollapse:(NSString *)adSpace;
  144. /*!
  145. * @brief Invoked when a space has been collapsed.
  146. * @since 4.1
  147. *
  148. * This method informs the app an ad space (typcially a banner) has been collapsed. Apps should resume their state when they receive this notification
  149. *
  150. * @param adSpace The placement of an ad in your app, where placement may
  151. * be splash screen for SPLASH_AD.
  152. */
  153. - (void) spaceDidCollapse:(NSString *)adSpace;
  154. /*!
  155. * @brief Informational callback invoked when an ad is clicked for the specified @c adSpace.
  156. * @since 4.1
  157. *
  158. * This method informs the app that an ad has been clicked. This should not be used to adjust state of an app. It is only intended for informational purposes.
  159. *
  160. * @param adSpace The placement of an ad in your app, where placement may
  161. * be splash screen for SPLASH_AD.
  162. */
  163. - (void) spaceDidReceiveClick:(NSString*)adSpace;
  164. /*!
  165. * @brief Invoked when a video finishes playing
  166. * @since 4.2.0
  167. *
  168. * This method informs the app that a video associated with an ad has finished playing
  169. *
  170. * @param adSpace The placement of an ad in your app, where placement may be splash screen for SPLASH_AD.
  171. *
  172. */
  173. - (void)videoDidFinish:(NSString *)adSpace;
  174. @optional
  175. #pragma mark App Keys
  176. /** @name Third party network Calls
  177. * Optional calls to pass information needed to display ads through 3rd parties.
  178. */
  179. //@{
  180. /*!
  181. * @brief The Millennial APID.
  182. * @since 4.0.0
  183. *
  184. * This is the id for your app as set in Millennial, found here: https://developer.millennialmedia.com/Application/index.php#manageApps.
  185. */
  186. - (NSString *)appSpotMillennialAppKey; //your millennial APID, found here: https://developer.millennialmedia.com/Application/index.php#manageApps
  187. /*!
  188. * @brief The Millennial APID for interstitials.
  189. * @since 4.0.0
  190. *
  191. * This is the id for your app as set in Millennial, found here: https://developer.millennialmedia.com/Application/index.php#manageApps.
  192. */
  193. - (NSString *)appSpotMillennialInterstitalAppKey;
  194. /*!
  195. * @brief The InMobi APID.
  196. * @since 4.0.0
  197. *
  198. * This is the id for your app as set in InMobi, found here: https://www.inmobi.com/pub/mysite.html?platFormType=all
  199. */
  200. - (NSString *)appSpotInMobiAppKey;
  201. /*!
  202. * @brief The AdMob Publisher Id.
  203. * @since 4.0.0
  204. *
  205. * This is the id for your app as set in AdMob, found here: http://www.admob.com/my_sites/ (click manage settings)
  206. */
  207. - (NSString *)appSpotAdMobPublisherID;
  208. /*!
  209. * @brief The Mobclix Application Id.
  210. * @since 4.0.0
  211. *
  212. * This is the id for your app as set in Mobclix
  213. */
  214. - (NSString *)appSpotMobclixApplicationID;
  215. /*!
  216. * @brief The Jumptap Publisher Id.
  217. * @since 4.1.2
  218. *
  219. * This is the pub id for your app as set in Jumptap
  220. */
  221. - (NSString *)appSpotJumptapPublisherID;
  222. /*!
  223. * @brief The Jumptap Site Id.
  224. * @since 4.1.2
  225. *
  226. * This is the site id for your app as set in Jumptap. It is an optional parameter.
  227. */
  228. - (NSString *)appSpotJumptapSiteID;
  229. /*!
  230. * @brief Jumptap Banner Ad Spot ID
  231. * @since 4.1.2
  232. *
  233. * This is the ad spot id for a Banner (320x50) ad spot set in JumpTap
  234. */
  235. - (NSString *)appSpotJumptapBannerAdSpotID;
  236. /*!
  237. * @brief Jumptap Leaderboard Ad Spot ID
  238. * @since 4.1.2
  239. *
  240. * This is the ad spot id for a Leaderboard (720x90) ad spot set in JumpTap
  241. */
  242. - (NSString *)appSpotJumptapLeaderboardAdSpotID;
  243. /*!
  244. * @brief Jumptap Medium Rectange Ad Spot ID
  245. * @since 4.1.2
  246. *
  247. * This is the ad spot id for a Medium Rectangle (320x50) ad spot set in JumpTap.
  248. * The Medium Rectangle Ad Spot ID will be used whenever the ad frame can fit it
  249. * (e.g. interstitial ads).
  250. */
  251. - (NSString *)appSpotJumptapMediumRectangleAdSpotID;
  252. /*!
  253. * @brief The Greystripe Application Id.
  254. * @since 4.0.0
  255. *
  256. * This is the id for your app as set in Greystripe
  257. */
  258. - (NSString *)appSpotGreystripeApplicationID;
  259. #pragma mark Information
  260. #pragma mark Callbacks
  261. /*!
  262. * @brief [Deprecated] Allow you to set your rootViewController.
  263. * @since 4.0.0
  264. * @deprecated
  265. *
  266. * This method has been deprecated. Please call FlurryAds#initialze: instead.
  267. *
  268. */
  269. - (id)appSpotRootViewController __attribute__ ((deprecated));
  270. #pragma mark Optional settings
  271. /**
  272. Some networks support accelerometer-enabled ads.
  273. */
  274. /*!
  275. * @brief For networks that support accelerometer-enabled ads.
  276. * @since 4.0.0
  277. *
  278. * This method allows you to enable accelerometer based ads for networks that support this setting via the client sdk. Set to NO if your app uses the accelerometer
  279. to avoid conflict. Set to YES if you want the special ads. Default is NO.
  280. */
  281. - (BOOL)appSpotAccelerometerEnabled;
  282. //@}
  283. @end