//
//  IntegratedAppDelegate.m
//  Integrated
//
//  Created by Bill Dudney on 12/27/08.
//  Copyright Gala Factory Software LLC 2008. All rights reserved.
//
//
//  Licensed with the Apache 2.0 License
//  http://apache.org/licenses/LICENSE-2.0
//

#import "IntegratedAppDelegate.h"
#import "IntegratedViewController.h"

@implementation IntegratedAppDelegate

@synthesize window;
@synthesize viewController;

- (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Override point for customization after app launch    
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
}

//START:code.integration.handleOpenURL
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  BOOL flag = NO;
  if([[url resourceSpecifier] length] < 25) {
    viewController.message = [[url resourceSpecifier] substringFromIndex:2];
    flag = YES;
  }
  // if the message is longer than 25 it might be malicious
  return flag;
}
//END:code.integration.handleOpenURL

- (void)dealloc {
    [viewController release];
    [window release];
    [super dealloc];
}


@end
