From 693332a0e1397f86e32e5d062ff866c5edf3ddfe Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Sun, 4 Nov 2012 12:29:50 -0800 Subject: [PATCH] Moved plugin to author's repo. --- iPhone/TestFlight/PGTestFlight.h | 25 -------- iPhone/TestFlight/PGTestFlight.m | 104 ------------------------------- iPhone/TestFlight/README.md | 1 + iPhone/TestFlight/TestFlight.js | 92 --------------------------- 4 files changed, 1 insertion(+), 221 deletions(-) delete mode 100644 iPhone/TestFlight/PGTestFlight.h delete mode 100644 iPhone/TestFlight/PGTestFlight.m create mode 100644 iPhone/TestFlight/README.md delete mode 100644 iPhone/TestFlight/TestFlight.js diff --git a/iPhone/TestFlight/PGTestFlight.h b/iPhone/TestFlight/PGTestFlight.h deleted file mode 100644 index 6c7ffddb..00000000 --- a/iPhone/TestFlight/PGTestFlight.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// PGTestFlight.h -// -// Created by Shazron Abdullah on 11-09-13. -// Copyright 2011 Nitobi Software Inc. All rights reserved. -// -#ifdef PHONEGAP_FRAMEWORK - #import -#else - #import "PGPlugin.h" -#endif - -@interface PGTestFlight : PGPlugin - -- (void)addCustomEnvironmentInformation:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -- (void)takeOff:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -- (void)setOptions:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -- (void)passCheckpoint:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -- (void)openFeedbackView:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;; - -@end diff --git a/iPhone/TestFlight/PGTestFlight.m b/iPhone/TestFlight/PGTestFlight.m deleted file mode 100644 index ca63d5f0..00000000 --- a/iPhone/TestFlight/PGTestFlight.m +++ /dev/null @@ -1,104 +0,0 @@ -// -// PGTestFlight.m -// -// Created by Shazron Abdullah on 11-09-13. -// Copyright 2011 Nitobi Software Inc. All rights reserved. -// - -#import "PGTestFlight.h" -#import "TestFlight.h" - -#ifdef PHONEGAP_FRAMEWORK - #import -#else - #import "PluginResult.h" -#endif - -@implementation PGTestFlight - -- (id)init -{ - self = [super init]; - if (self) { - // Initialization code here. - } - - return self; -} - -- (void) addCustomEnvironmentInformation:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options -{ - NSString* callbackId = [arguments pop]; - PluginResult* result = nil; - - NSString* key = [options objectForKey:@"key"]; - NSString* information = [options objectForKey:@"information"]; - - if (key && information) { - [TestFlight addCustomEnvironmentInformation:information forKey:key]; - result = [PluginResult resultWithStatus:PGCommandStatus_OK]; - [super writeJavascript:[result toSuccessCallbackString:callbackId]]; - } else { - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"information or key property is missing."]; - [super writeJavascript:[result toErrorCallbackString:callbackId]]; - } -} - -- (void) takeOff:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options -{ - NSString* callbackId = [arguments pop]; - PluginResult* result = nil; - - NSString* teamToken = [options objectForKey:@"teamToken"]; - if (teamToken) { - [TestFlight takeOff:teamToken]; - result = [PluginResult resultWithStatus:PGCommandStatus_OK]; - [super writeJavascript:[result toSuccessCallbackString:callbackId]]; - } else { - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"teamToken property is missing."]; - [super writeJavascript:[result toErrorCallbackString:callbackId]]; - } -} - -- (void)setOptions:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options -{ - NSString* callbackId = [arguments pop]; - PluginResult* result = nil; - - if ([options count] > 0) { - [TestFlight setOptions:options]; - result = [PluginResult resultWithStatus:PGCommandStatus_OK]; - [super writeJavascript:[result toSuccessCallbackString:callbackId]]; - } else { - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"options dictionary is empty."]; - [super writeJavascript:[result toErrorCallbackString:callbackId]]; - } -} - -- (void) passCheckpoint:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options -{ - NSString* callbackId = [arguments pop]; - PluginResult* result = nil; - - NSString* checkpointName = [options objectForKey:@"checkpointName"]; - if (checkpointName) { - [TestFlight passCheckpoint:checkpointName]; - result = [PluginResult resultWithStatus:PGCommandStatus_OK]; - [super writeJavascript:[result toSuccessCallbackString:callbackId]]; - } else { - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"checkpointName property is missing."]; - [super writeJavascript:[result toErrorCallbackString:callbackId]]; - } -} - -- (void) openFeedbackView:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options -{ - NSString* callbackId = [arguments pop]; - - [TestFlight openFeedbackView]; - - PluginResult* result = [PluginResult resultWithStatus:PGCommandStatus_OK]; - [super writeJavascript:[result toSuccessCallbackString:callbackId]]; -} - -@end diff --git a/iPhone/TestFlight/README.md b/iPhone/TestFlight/README.md new file mode 100644 index 00000000..082f94ab --- /dev/null +++ b/iPhone/TestFlight/README.md @@ -0,0 +1 @@ +This plugin has been moved to [http://github.com/shazron/TestFlightPlugin](http://github.com/shazron/TestFlightPlugin) \ No newline at end of file diff --git a/iPhone/TestFlight/TestFlight.js b/iPhone/TestFlight/TestFlight.js deleted file mode 100644 index 49771f78..00000000 --- a/iPhone/TestFlight/TestFlight.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - TestFlight Plugin for PhoneGap. - Created by Shazron Abdullah, Nitobi Software Inc. - - 1. Include the TestFlight SDK files in Xcode (follow their instructions) - 2. Add PGTestFlight.h and .m in Xcode - 3. Add TestFlight.js to your www folder, and reference it in a script tag after your phonegap.js - 4. In PhoneGap.plist, under the 'Plugins' key, add a new row: key is "com.phonegap.testflightsdk" and the value is "PGTestFlight" - 5. In PhoneGap.plist, under the 'ExternalHosts' key, add a new value "testflightapp.com" - - The plugin's JavaScript functions are under the global "window.plugins.TestFlight" object. - See the functions below (and the TestFlight SDK docs) for usage. Unfortunately all of TestFlight's SDK functions return void, - and errors can only be gleaned from the run console, so check that for errors. - */ - -if (!PhoneGap.hasResource("TestFlight")) { - PhoneGap.addResource("TestFlight"); - -TestFlight = function() { - this.serviceName = "com.phonegap.testflightsdk"; -}; - -/* - Add custom environment information - If you want to track a user name from your application you can add it here - - @param successCallback function - @param failureCallback function - @param key string - @param information string - */ -TestFlight.prototype.addCustomEnvironmentInformation = function(successCallback, failureCallback, key, information) { - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "addCustomEnvironmentInformation", - [{ key: key, information: information }]); -}; - -/* - Starts a TestFlight session - - @param successCallback function - @param failureCallback function - @param teamToken string - */ -TestFlight.prototype.takeOff = function(successCallback, failureCallback, teamToken) { - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "takeOff", [{ teamToken: teamToken }]); -}; - -/* - Sets custom options - - @param successCallback function - @param failureCallback function - @param options object i.e { reinstallCrashHandlers : true } - */ -TestFlight.prototype.setOptions = function(successCallback, failureCallback, options) { - if (!(null !== options && 'object' == typeof(options))) { - options = {}; - } - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "setOptions", [ options ]); -}; - -/* - Track when a user has passed a checkpoint after the flight has taken off. Eg. passed level 1, posted high score - - @param successCallback function - @param failureCallback function - @param checkpointName string - */ -TestFlight.prototype.passCheckpoint = function(successCallback, failureCallback, checkpointName) { - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "passCheckpoint", [{ checkpointName: checkpointName }]); -}; - -/* - Opens a feeback window that is not attached to a checkpoint - - @param successCallback function - @param failureCallback function - */ -TestFlight.prototype.openFeedbackView = function(successCallback, failureCallback) { - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "openFeedbackView", []); -}; - - -TestFlight.install = function() -{ - if (typeof window.plugins == "undefined") window.plugins = {}; - if (typeof window.plugins.TestFlight == "undefined") window.plugins.TestFlight = new TestFlight(); -} - -PhoneGap.addConstructor(TestFlight.install); - -};