summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/Stone Island/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/Stone Island/Classes')
-rw-r--r--StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h13
-rw-r--r--StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m120
-rw-r--r--StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m33
3 files changed, 10 insertions, 156 deletions
diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h b/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h
index ee3f0764..69ba6c08 100644
--- a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h
+++ b/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h
@@ -25,18 +25,9 @@
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//
-#import <UIKit/UIKit.h>
-
#import <Cordova/CDVViewController.h>
+#import <Cordova/CDVAppDelegate.h>
-@interface AppDelegate : NSObject <UIApplicationDelegate>{}
-
-// invoke string is passed to your app on launch, this is only valid if you
-// edit Stone Island-Info.plist to add a protocol
-// a simple tutorial can be found here :
-// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
-
-@property (nonatomic, strong) IBOutlet UIWindow* window;
-@property (nonatomic, strong) IBOutlet CDVViewController* viewController;
+@interface AppDelegate : CDVAppDelegate {}
@end
diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m b/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m
index c2d42df8..bc84bed9 100644
--- a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m
+++ b/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m
@@ -28,128 +28,12 @@
#import "AppDelegate.h"
#import "MainViewController.h"
-#import <Cordova/CDVPlugin.h>
-
@implementation AppDelegate
-@synthesize window, viewController;
-
-- (id)init
-{
- /** If you need to do any extra app-specific initialization, you can do it here
- * -jm
- **/
- NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-
- [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
-
- int cacheSizeMemory = 8 * 1024 * 1024; // 8MB
- int cacheSizeDisk = 32 * 1024 * 1024; // 32MB
-#if __has_feature(objc_arc)
- NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
-#else
- NSURLCache* sharedCache = [[[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"] autorelease];
-#endif
- [NSURLCache setSharedURLCache:sharedCache];
-
- self = [super init];
- return self;
-}
-
-#pragma mark UIApplicationDelegate implementation
-
-/**
- * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
- */
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
- CGRect screenBounds = [[UIScreen mainScreen] bounds];
-
-#if __has_feature(objc_arc)
- self.window = [[UIWindow alloc] initWithFrame:screenBounds];
-#else
- self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];
-#endif
- self.window.autoresizesSubviews = YES;
-
-#if __has_feature(objc_arc)
- self.viewController = [[MainViewController alloc] init];
-#else
- self.viewController = [[[MainViewController alloc] init] autorelease];
-#endif
-
- // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml.
- // If necessary, uncomment the line below to override it.
- // self.viewController.startPage = @"index.html";
-
- // NOTE: To customize the view's frame size (which defaults to full screen), override
- // [self.viewController viewWillAppear:] in your view controller.
-
- self.window.rootViewController = self.viewController;
- [self.window makeKeyAndVisible];
-
- return YES;
-}
-
-// this happens while we are running ( in the background, or from within our own app )
-// only valid if Stone Island-Info.plist specifies a protocol to handle
-- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
-{
- if (!url) {
- return NO;
- }
-
- // all plugins will get the notification, and their handlers will be called
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
-
- return YES;
-}
-
-// repost all remote and local notification using the default NSNotificationCenter so multiple plugins may respond
-- (void) application:(UIApplication*)application
- didReceiveLocalNotification:(UILocalNotification*)notification
-{
- // re-post ( broadcast )
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
-}
-
-#ifndef DISABLE_PUSH_NOTIFICATIONS
-
- - (void) application:(UIApplication*)application
- didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
- {
- // re-post ( broadcast )
- NSString* token = [[[[deviceToken description]
- stringByReplacingOccurrencesOfString:@"<" withString:@""]
- stringByReplacingOccurrencesOfString:@">" withString:@""]
- stringByReplacingOccurrencesOfString:@" " withString:@""];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
- }
-
- - (void) application:(UIApplication*)application
- didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
- {
- // re-post ( broadcast )
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
- }
-#endif
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
-#else
-- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
-#endif
-{
- // iPhone doesn't support upside down by default, while the iPad does. Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).
- NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
-
- return supportedInterfaceOrientations;
-}
-
-- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
-{
- [[NSURLCache sharedURLCache] removeAllCachedResponses];
+ self.viewController = [[MainViewController alloc] init];
+ return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m b/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m
index a066b197..3f3a0c8e 100644
--- a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m
+++ b/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m
@@ -84,12 +84,6 @@
// e.g. self.myOutlet = nil;
}
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
-{
- // Return YES for supported orientations
- return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
-}
-
/* Comment out the block below to over-ride */
/*
@@ -97,35 +91,20 @@
{
return[super newCordovaViewWithFrame:bounds];
}
-*/
-
-#pragma mark UIWebDelegate implementation
-- (void)webViewDidFinishLoad:(UIWebView*)theWebView
+- (NSUInteger)supportedInterfaceOrientations
{
- // Black base color for background matches the native apps
- theWebView.backgroundColor = [UIColor blackColor];
-
- return [super webViewDidFinishLoad:theWebView];
+ return [super supportedInterfaceOrientations];
}
-/* Comment out the block below to over-ride */
-
-/*
-
-- (void) webViewDidStartLoad:(UIWebView*)theWebView
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
- return [super webViewDidStartLoad:theWebView];
-}
-
-- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
-{
- return [super webView:theWebView didFailLoadWithError:error];
+ return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
-- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
+- (BOOL)shouldAutorotate
{
- return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
+ return [super shouldAutorotate];
}
*/