Posts tagged ·

free app

·...

Implementing iAd in iPhone applications

no comments

There are a couple of tricks to implementing iAd in iPhone applications that are not 100% spelled out in the documentation provided by Apple. If you do not implement right your app will crash on phones running older versions of iOS such as iOS4.1 and iOS3.

For your .h file:

#import <UIKit/UIKit.h>;
#import <iAd/iAd.h>;
@interface iAdViewController : UIViewController <ADBannerViewDelegate> {
	ADBannerView *adView;
 	BOOL bannerIsVisible;
}
@property (nonatomic,assign) BOOL bannerIsVisible;
@end

In the .m file you need the following:

- (void) viewWillAppear:(BOOL)animated {
	// check if iAd is available
	Class classAdBannerView = NSClassFromString(@"ADBannerView");
	if (classAdBannerView) {
		// create iAd
		ADBannerView *bannerView = [[classAdBannerView alloc] initWithFrame:CGRectZero];

		if (&ADBannerContentSizeIdentifierPortrait != nil) {
			// NEWER
			DLog(@"NEWER");
			bannerView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
			bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
		} else {
			// OLDER
			DLog(@"OLDER");
			bannerView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
			bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
		}

		bannerView.delegate=self;

		self.adView = bannerView;
		[self.view addSubview:adView];
		self.bannerIsVisible=NO;
		[bannerView release];

	}
	[super viewWillAppear: animated];
}

I am creating the bannerView programatically in order to have the app also work on pre iOS 4.1 devices. The check for ADBannerContentSizeIdentifierPortrait is to see if the user is using iOS 4.1 or newer iOS. In iOS 4.1 the identifiers were based on size – but in newer iOS the iPad got iAds and the size no longer made sense – thus the landscape/portrait designations.

Finally – if your app supports multiple interface orientations – you need to let the banner know that the device rotated so it can show the right size ad.

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

    if (&ADBannerContentSizeIdentifierPortrait != nil) {
        // NEWER
		DLog(@"NEWER");
        if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
        else
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    } else {
        // OLDER
		DLog(@"OLDER");
        if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
        else
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
    }
}
Share

Driving traffic to your app by launching free tools

no comments

LogYourRun is a site for active people – runners, hikers, and cyclists.  To generate interest and app sales for the paid version of the LogYourRun iPhone app I have decided to launch a series of free running tools.  The hope is that the target audience of LogYourRun will be looking for apps that can solve simple problems for them – such as measure heart rate and calculate heart rate zones and calculate pace based on distance and time – and they download these apps they will see advertisement for the paid LogYourRun app which will potentially dive sales of this app.

Here are the free apps:

  1. A free version of the GPS/pedometer app.
  2. A free heart rate measurement tool.
  3. A free Pace Calculator

All of these are tools that runners might look for on the app store and all of these apps have links to the full LogYourRun app and the YouTube video showing what a great app that is.

The LYR Free (GPS/pedometer) has been in the app store for several months but interestingly has not been hugely successful maybe because of the lack of brand name recognition or because the paid version is so cheap

The Heart Rate tool (HR) has proved to be hugely successful – probably because it is one of the few free apps that will let you measure your heart rate and calculate your heart rate zones.  I still need to integrate pinch analytics to see if this is actually driving traffic to the full app – but since the HR app has launched the sales for the full app has gone up 3 fold.

The Pace Calculator will go live this week and I look forward to seeing the response to this app.

Share