Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Nov 8, 2011
0 parents commit 89c8697
Show file tree
Hide file tree
Showing 31 changed files with 782 additions and 0 deletions.
483 changes: 483 additions & 0 deletions MapBox iPhone.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions MapBox iPhone/Classes/AppDelegate.h
@@ -0,0 +1,29 @@
//
// AppDelegate.h
// MapBox iPhone
//
// Created by Tom MacWright on 11/8/11.
// Copyright __MyCompanyName__ 2011. All rights reserved.
//

#import <UIKit/UIKit.h>
#ifdef PHONEGAP_FRAMEWORK
#import <PhoneGap/PhoneGapDelegate.h>
#else
#import "PhoneGapDelegate.h"
#endif

@interface AppDelegate : PhoneGapDelegate {

NSString* invokeString;
}

// invoke string is passed to your app on launch, this is only valid if you
// edit MapBox iPhone.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 (copy) NSString* invokeString;

@end

112 changes: 112 additions & 0 deletions MapBox iPhone/Classes/AppDelegate.m
@@ -0,0 +1,112 @@
//
// AppDelegate.m
// MapBox iPhone
//
// Created by Tom MacWright on 11/8/11.
// Copyright __MyCompanyName__ 2011. All rights reserved.
//

#import "AppDelegate.h"
#ifdef PHONEGAP_FRAMEWORK
#import <PhoneGap/PhoneGapViewController.h>
#else
#import "PhoneGapViewController.h"
#endif

@implementation AppDelegate

@synthesize invokeString;

- (id) init
{
/** If you need to do any extra app-specific initialization, you can do it here
* -jm
**/
return [super init];
}

/**
* 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
{

NSArray *keyArray = [launchOptions allKeys];
if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil)
{
NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]];
self.invokeString = [url absoluteString];
NSLog(@"MapBox iPhone launchOptions = %@",url);
}

return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

// this happens while we are running ( in the background, or from within our own app )
// only valid if MapBox iPhone.plist specifies a protocol to handle
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
// must call super so all plugins will get the notification, and their handlers will be called
// super also calls into javascript global function 'handleOpenURL'
return [super application:application handleOpenURL:url];
}

-(id) getCommandInstance:(NSString*)className
{
/** You can catch your own commands here, if you wanted to extend the gap: protocol, or add your
* own app specific protocol to it. -jm
**/
return [super getCommandInstance:className];
}

/**
Called when the webview finishes loading. This stops the activity view and closes the imageview
*/
- (void)webViewDidFinishLoad:(UIWebView *)theWebView
{
// only valid if MapBox iPhone.plist specifies a protocol to handle
if(self.invokeString)
{
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
return [ super webViewDidFinishLoad:theWebView ];
}

- (void)webViewDidStartLoad:(UIWebView *)theWebView
{
return [ super webViewDidStartLoad:theWebView ];
}

/**
* Fail Loading With Error
* Error - If the webpage failed to load display an error with the reason.
*/
- (void)webView:(UIWebView *)theWebView didFailLoadWithError:(NSError *)error
{
return [ super webView:theWebView didFailLoadWithError:error ];
}

/**
* Start Loading Request
* This is where most of the magic happens... We take the request(s) and process the response.
* From here we can re direct links and other protocalls to different internal methods.
*/
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
}


- (BOOL) execute:(InvokedUrlCommand*)command
{
return [ super execute:command];
}

- (void)dealloc
{
[ super dealloc ];
}

@end
49 changes: 49 additions & 0 deletions MapBox iPhone/MapBox iPhone-Info.plist
@@ -0,0 +1,49 @@
<?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>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
<string>icon@2x.png</string>
<string>icon-72.png</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIdentifier</key>
<string>mapbox.MapBox_iPhone</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/>
<key>NSMainNibFile</key>
<string></string>
<key>NSMainNibFile~ipad</key>
<string></string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions MapBox iPhone/MapBox iPhone-Prefix.pch
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'MapBox iPhone' target in the 'MapBox iPhone' project
//

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
55 changes: 55 additions & 0 deletions MapBox iPhone/PhoneGap.plist
@@ -0,0 +1,55 @@
<?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>DetectPhoneNumber</key>
<true/>
<key>TopActivityIndicator</key>
<string>gray</string>
<key>EnableLocation</key>
<false/>
<key>EnableAcceleration</key>
<true/>
<key>EnableViewportScale</key>
<false/>
<key>AutoHideSplashScreen</key>
<true/>
<key>ShowSplashScreenSpinner</key>
<true/>
<key>MediaPlaybackRequiresUserAction</key>
<false/>
<key>AllowInlineMediaPlayback</key>
<false/>
<key>OpenAllWhitelistURLsInWebView</key>
<false/>
<key>ExternalHosts</key>
<array/>
<key>Plugins</key>
<dict>
<key>com.phonegap.accelerometer</key>
<string>PGAccelerometer</string>
<key>com.phonegap.camera</key>
<string>PGCamera</string>
<key>com.phonegap.connection</key>
<string>PGConnection</string>
<key>com.phonegap.contacts</key>
<string>PGContacts</string>
<key>com.phonegap.debugconsole</key>
<string>PGDebugConsole</string>
<key>com.phonegap.file</key>
<string>PGFile</string>
<key>com.phonegap.filetransfer</key>
<string>PGFileTransfer</string>
<key>com.phonegap.geolocation</key>
<string>PGLocation</string>
<key>com.phonegap.notification</key>
<string>PGNotification</string>
<key>com.phonegap.media</key>
<string>PGSound</string>
<key>com.phonegap.mediacapture</key>
<string>PGCapture</string>
<key>com.phonegap.splashscreen</key>
<string>PGSplashScreen</string>
</dict>
</dict>
</plist>
1 change: 1 addition & 0 deletions MapBox iPhone/Plugins/README
@@ -0,0 +1 @@
Put the .h and .m files of your plugin here. The .js files of your plugin belong in the www folder.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions MapBox iPhone/Resources/en.lproj/Localizable.strings
@@ -0,0 +1,14 @@
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
* Copyright (c) 2011, IBM Corporation
*/


// accessibility label for recording button
"toggle audio recording" = "toggle audio recording";
// notification spoken by VoiceOver when timed recording finishes
"timed recording complete" = "timed recording complete";
// accessibility hint for display of recorded elapsed time
"recorded time in minutes and seconds" = "recorded time in minutes and seconds";
13 changes: 13 additions & 0 deletions MapBox iPhone/Resources/es.lproj/Localizable.strings
@@ -0,0 +1,13 @@
/*
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
* Copyright (c) 2011, IBM Corporation
*/

// accessibility label for recording button
"toggle audio recording" = "grabación de audio cambiar";
// notification spoken by VoiceOver when timed recording finishes
"timed recording complete" = "tiempo de grabación completo";
// accessibility hint for display of recorded elapsed time
"recorded time in minutes and seconds" = "tiempo registrado en minutos y segundos";
Binary file added MapBox iPhone/Resources/icons/icon-72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapBox iPhone/Resources/icons/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapBox iPhone/Resources/icons/icon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapBox iPhone/Resources/splash/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MapBox iPhone/Resources/splash/Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions MapBox iPhone/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

17 changes: 17 additions & 0 deletions MapBox iPhone/main.m
@@ -0,0 +1,17 @@
//
// main.m
// MapBox iPhone
//
// Created by Tom MacWright on 11/8/11.
// Copyright __MyCompanyName__ 2011. All rights reserved.
//

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
[pool release];
return retVal;
}

0 comments on commit 89c8697

Please sign in to comment.