No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.project
LICENSE
README
adsAutoSwither.js

README

Ads Auto Switcher - ©BSoft&Co 2012
----------------------------------

This script allows you to use both iAds and Admob at the same place within
a ©Titanium iOS project.

It works with ti.admob module (1.3) which can be found here :
https://github.com/appcelerator/titanium_modules/tree/master/admob/mobile/ios
or from Appcelerator Market Place.

For now, only iphone's screen size is managed, in portrait orientation (both iphone 5 and below).

Per default, Admob is always shown, while iAds is shown (on top of admob) and 
hidden during some seconds.
The script manages to move or to resize an UI object when ads are visible.

Be carefull with admob when closing a window. The module ti.admob is not 
really good to stop a refreshing admob.. :/
-------------------------------------------------------------------------------


history:
--------
v2.0.011
    correct the bad value name for var setIAdsTimeToShow method!
v2.0.010
    better init for _iads var ;)
    extra iads and admob parameters now privates
v2.0.009
    change log level from info to debug
v2.0.008
    Add how to use
v2.0.007
    Add setSingleContextWin() for single context application
v2.0.006
    Clean old comments and code
V2.0.005
    Add animation curve:Ti.UI.ANIMATION_CURVE_EASE_IN_OUT for showing ads
v2.0.004
    Correction when ad banner's position is fixed
v2.0.003
    setAdsTopInit to init the top px for both admob and iads
v2.0.001
    setInterval() for iAds instead of setTimeout
v2.0.000
    Rewrite and simplification for ads.js, renammed as adsAutoSwitcher
    Compatible with Ti SDK > 2
    commonJS archi
v1.25
    ± Change : ads.objHmax = Ti.Platform.displayCaps.platformHeight - 20; --> for iPhone 5 
v1.24.01
    + Change 'auto' size for iAds to Ti.UI.SIZE to be ready with Ti sdk 2
    ± Only load ti.admob if needed
v1.23
    + Now compatible with ti.admob >= 1.2
    + Add the values 'adDateOfBirth', 'adGender', 'adKeywords' and 'adTesting' for admob
    + Add the possibility to use or not iAds, like useAdmob : ads.useIads
v1.22
    - delete 'adDelay' parameter
v1.21
    + ads.alterType = '' for fixed ads. Set ads.obj2Move = null
V1.2
    + ads.useAdmob = true/false : to enabled or not admob. If false, only iAds 
    is shown
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
How To use : 
------------
    This adsAutoSwitcher prints the ads on top of a tableview object by moving it down
    The ads are delayed of 2sec
    ie : Before : tableview top = 0, height = 200, after : top = 50, height = 200
    
    var myAds = require ('modules/adsAutoSwither');
    var ads = new myAds();
    ads.setAdmobPublisherId('myAdmobKey');
    ads.setIadsShowHide('iAdsShowHide.Window');
    ads.setGlobalDelayStart(2000);
    ads.showAdvert(tableView,'move','top');

    Same as before, but now, the tableview is resized from its top
    ie : Before : tableview top = 0, height = 200, after : top = 50, height = 150
    [...]
    ads.showAdvert(tableView,'resize','top');

    Same as before, but now, the tableview is resized from its bottom
    ie : Before : tableview top = 0, height = 200, after : top = 0, height = 150
    so bottom is now 150
    [...]
    ads.showAdvert(tableView,'resize','bottom');

    Fixed banner at top = 120. No UI object resized or moved
    [...]
    ads.setAdsTopInit(120);
    ads.showAdvert(tableView,'','');
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Ads Auto Switcher is licensed under the Apache Public License (Version 2). 
Please see the LICENSE file for the full license.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------