adview_ios.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #include <bbmonkey.h>
  2. #include "../../std/async/native/async_cb.h"
  3. #ifdef __OBJC__
  4. #import "GoogleMobileAds/GADBannerView.h"
  5. #import "GoogleMobileAds/GADInterstitial.h"
  6. #import "GoogleMobileAds/GADRewardBasedVideoAd.h"
  7. #import "GoogleMobileAds/GADRewardBasedVideoAdDelegate.h"
  8. #import "GoogleMobileAds/GADAdReward.h"
  9. @interface BBAdmobDelegate : NSObject<GADBannerViewDelegate,GADInterstitialDelegate,GADRewardBasedVideoAdDelegate>
  10. @end
  11. #else
  12. #include <objc/objc.h>
  13. typedef struct objc_object BBAdmobDelegate;
  14. typedef struct objc_object GADRequest;
  15. typedef struct objc_object GADInterstitial;
  16. typedef struct objc_object GADBannerView;
  17. typedef struct objc_object GADRewardBasedVideoAd;
  18. #endif
  19. class BBAdView : public bbObject{
  20. public:
  21. BBAdView(){}
  22. BBAdView( bbString size,bbString layout,bbString adUnitId,bbBool visible );
  23. void start( int callback );
  24. void setState( int state );
  25. void setVisible( bool visible );
  26. bool getVisible();
  27. int getState();
  28. bbString getRewardType();
  29. int getRewardAmount();
  30. void consumeReward();
  31. int getError();
  32. void reload();
  33. void createRewardBasedVideoAd();
  34. void createInterstitialAd();
  35. void createBannerAd();
  36. // private:
  37. bbString _size;
  38. bbString _layout;
  39. bbString _adUnitId;
  40. bbBool _visible;
  41. int _callback=0;
  42. int _state=0;
  43. BBAdmobDelegate *_adDelegate=0;
  44. GADRewardBasedVideoAd *_rewardBasedVideoAd=0;
  45. GADInterstitial *_interstitialAd=0;
  46. GADBannerView *_adView=0;
  47. GADRequest *_adRequest=0;
  48. bbString _rewardType="";
  49. int _rewardAmount=0;
  50. int _error=0;
  51. };