Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @JS('AdMob')
- library AdMob;
- import "package:func/func.dart";
- import "package:js/js.dart";
- import 'dart:html';
- /**
- * TypeScript Definition for the cordova-admob-pro Cordova Plugin
- * https://github.com/floatinghotpot/cordova-admob-pro
- */
- declare class AdMob {
- /**
- * See google doc: http://developer.android.com/google/play-services/id.html
- * See apple doc: https://developer.apple.com/library/ios/documentation/AdSupport/Reference/ASIdentifierManager_Ref/
- *
- * getAdSettings(function(data){
- * data.adId; // UUID String
- * data.adTrackingEnabled; // bool
- * }, function(){
- * // fail to get user ad settings
- * });
- */
- external static void getAdSettings(Function successCallback , Function failureCallback );
- /**
- * Set ad options
- * Expects an instance of the AdMobOptions class
- */
- external static void setOptions(Object options , Function successCallback , Function failureCallback );
- /** Create and display a banner ad */
- external static void createBanner(Object args , Function successCallback , Function failureCallback );
- /** Remove the currently displayed banner ad */
- external static void removeBanner(Function successCallback , Function failureCallback );
- /** Hide the currently displayed banner ad */
- external static void hideBanner(Function successCallback , Function failureCallback );
- /** Show the currently hidden banner ad */
- external static void showBanner(Function successCallback , Function failureCallback );
- /** Show the current banner ad at a specific (x, y) location */
- external static void showBannerAtXY(Number x , Number y , Function successCallback , Function failureCallback );
- /** Prepare an interstitial ad in the background */
- external static void prepareInterstitial(Object args , Function successCallback , Function failureCallback );
- /** Show an interstitial ad that has been prepared */
- external static void showInterstitial(Function successCallback , Function failureCallback );
- /** Check if an interstitial ad is ready yet or not */
- external static void isInterstitialReady(Function successCallback , Function failureCallback );
- /** Prepare a reward video ad */
- external static void prepareRewardVideoAd(Object args , Function successCallback , Function failureCallback );
- /** Show a prepared reward video ad */
- external static void showRewardVideoAd(Function successCallback , Function failureCallback );
- }
- declare module AdMob {
- /** Constants for the various ad sizes */
- class AD_SIZE {
- static String SMART_BANNER;
- static String BANNER;
- static String MEDIUM_RECTANGLE;
- static String FULL_BANNER;
- static String LEADERBOARD;
- static String SKYSCRAPER;
- }
- /** Constants for the various ad positions */
- class AD_POSITION {
- static Number NO_CHANGE;
- static Number TOP_LEFT;
- static Number TOP_CENTER;
- static Number TOP_RIGHT;
- static Number LEFT;
- static Number CENTER;
- static Number RIGHT;
- static Number BOTTOM_LEFT;
- static Number BOTTOM_CENTER;
- static Number BOTTOM_RIGHT;
- static Number POS_XY;
- }
- /**
- * Class used to pass in all ad options to be used by default for all ads
- * Unfortunately the extension uses generic objects, so this class can't be used :-(
- * Keeping here commented out for reference sake (and a nudge to hopefully use it in the extension)
- */
- /*class AdMobOptions {
- // The ID of the ad to show
- String public adId;
- // The ID of the specific banner ad to show
- String public bannerId;
- // The ID of the specific interstitial ad to show
- String public interstitialId;
- // Banner type size
- String public adSize;
- // Banner width, if set adSize to 'CUSTOM'
- Number public width;
- // Banner height, if set adSize to 'CUSTOM'
- Number public height;
- // Default position
- Number public position;
- // Default X of banner
- public x:Number
- // Default Y of banner
- Number public y;
- // If set to true, to receive test ads
- Boolean public isTesting;
- // If set to true, no need call showBanner or showInterstitial
- Boolean public autoShow;
- // Extra ad setting options
- dynamic public adExtra;
- // Whether or not to output verbose logs
- Boolean public logVerbose;
- // Whether or not ads can overlap
- Boolean public overlap;
- // Refresh the render of the ad if the orientation changes
- Boolean public orientationRenew;
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement