Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ars committed Mar 19, 2009
0 parents commit 822b059
Show file tree
Hide file tree
Showing 15 changed files with 1,777 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
/build
82 changes: 82 additions & 0 deletions AdMob/AdMobDelegateProtocol.h
@@ -0,0 +1,82 @@
/**
* AdMobDelegateProtocol.h
* AdMob iPhone SDK publisher code.
*
* Defines the AdMobDelegate protocol.
*/
@class AdMobView;

@protocol AdMobDelegate<NSObject>

@required

// Use this to provide a publisher id for an ad request. Get a publisher id
// from http://www.admob.com
- (NSString *)publisherId;

@optional

// Sent when an ad request loaded an ad; this is a good opportunity to add
// this view to the hierachy, if it has not yet been added.
// Note that this will only ever be sent once per AdMobView, regardless of whether
// new ads are subsequently requested in the same AdMobView.
- (void)didReceiveAd:(AdMobView *)adView;

// Sent when an ad request failed to load an ad.
// Note that this will only ever be sent once per AdMobView, regardless of whether
// new ads are subsequently requested in the same AdMobView.
- (void)didFailToReceiveAd:(AdMobView *)adView;

// Specifies the ad background color, for tile+text ads.
// Defaults to [UIColor colorWithRed:0.443 green:0.514 blue:0.631 alpha:1], which is a chrome-y color.
// Note that the alpha channel in the provided color will be ignored and treated as 1.
// We recommend against using a white or very light color as the background color, but
// if you do, be sure to implement adTextColor and useGraySpinner.
// Grayscale colors won't function correctly here. Use e.g. [UIColor colorWithRed:0 green:0 blue:0 alpha:1]
// instead of [UIColor colorWithWhite:0 alpha:1] or [UIColor blackColor].
- (UIColor *)adBackgroundColor;

// Specifies the ad text color, for tile+text ads.
// Defaults to [UIColor whiteColor].
// Note that the alpha channel in the provided color will be ignored and treated as 1.
- (UIColor *)adTextColor;

// When a spinner is shown over the adBackgroundColor (e.g. on clicks), it is by default
// a white spinner. If this returns YES, a gray spinner will be used instead,
// which looks better when the adBackgroundColor is white or very light in color.
- (BOOL)useGraySpinner;

// Whether AdMob may request location information from the phone. Defaults to NO.
// We ask that you respect your users' privacy and only enable location requests
// if your app already uses location information.
// Note that even if this is set to no, you will still need to include the CoreLocation
// framework to compile your app; it will simply not get used. (It is a dynamic
// framework, so including it will not increase the size of your app.)
- (BOOL)mayAskForLocation;

// If implemented, lets you specify whether to issue a real ad request or a test
// ad request (to be used for development only, of course). Defaults to NO.
- (BOOL)useTestAd;

// The following functions, if implemented, provide extra information
// for the ad request. If you happen to have this information, providing it will
// help select better targeted ads and will improve monetization.
// Note that providing a search string may seriously negatively impact your fill rate; we
// recommend using it only when the user is submitting a free-text search request
// and you want to _only_ display ads relevant to that search. In those situations,
// however, providing a search string can yield a significant monetization boost.
- (NSString *)postalCode; // user's postal code, e.g. "94401"
- (NSString *)areaCode; // user's area code, e.g. "415"
- (NSDate *)dateOfBirth; // user's date of birth
- (NSString *)gender; // user's gender (e.g. @"m" or @"f")
- (NSString *)searchString; // a search string the user has provided

// Sent just before presenting a canvas page. Use this opportunity to (say)
// stop animations, time sensitive interactions, etc.
- (void)willPresentModalCanvas;

// Sent just after dismissing a canvas page. Use this opportunity to
// restart anything you may have stopped as part of -willPresentModalCanvas:.
- (void)didDismissModalCanvas;

@end
38 changes: 38 additions & 0 deletions AdMob/AdMobView.h
@@ -0,0 +1,38 @@
/**
* AdMobView.h
* AdMob iPhone SDK publisher code.
*
* The entry point for requesting an AdMob ad to display.
*/
#import <UIKit/UIKit.h>

@protocol AdMobDelegate;

@interface AdMobView : UIView

/**
* Initiates an ad request and returns a view that will contain the results;
* the delegate is alerted when the ad is ready to display (or has failed to
* load); this is a good opportunity to attach the view to your hierarchy.
* If you already have a AdMobView with an ad loaded, and simply want to show
* a new ad in the same location, you may use -requestFreshAd instead (see below).
*
* This method should only be called from a run loop in default run loop mode.
* If you don't know what that means, you're probably ok. If in doubt, check
* whether ([[NSRunLoop currentRunLoop] currentMode] == NSDefaultRunLoopMode).
*/
+ (AdMobView *)requestAdWithDelegate:(id<AdMobDelegate>)delegate;

/**
* Causes an existing AdMobView to display a fresh ad. If an ad successfully loads,
* it is animated in with a flip; if not, this call fails silently and the old
* ad remains onscreen.
*
* Note that, during the flip, views under the AdMobView will be exposed.
*
* To preserve the user experience, we recommend loading fresh ads no more
* frequently than once per minute.
*/
- (void)requestFreshAd;

@end
Binary file added AdMob/libAdMobDevice.a
Binary file not shown.
Binary file added AdMob/libAdMobSimulator.a
Binary file not shown.
28 changes: 28 additions & 0 deletions Info.plist
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.sadun.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
</dict>
</plist>
7 changes: 7 additions & 0 deletions MIMEHelper.h
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface MIMEHelper : NSObject
{
}
+ (NSString *) mimeForExt: (NSString *) ext;
@end

0 comments on commit 822b059

Please sign in to comment.