Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved plugin to author's repo.

  • Loading branch information...
commit 693332a0e1397f86e32e5d062ff866c5edf3ddfe 1 parent 42b6e2b
@shazron shazron authored
View
25 iPhone/TestFlight/PGTestFlight.h
@@ -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 <PhoneGap/PGPlugin.h>
-#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
View
104 iPhone/TestFlight/PGTestFlight.m
@@ -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 <PhoneGap/PluginResult.h>
-#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
View
1  iPhone/TestFlight/README.md
@@ -0,0 +1 @@
+This plugin has been moved to [http://github.com/shazron/TestFlightPlugin](http://github.com/shazron/TestFlightPlugin)
View
92 iPhone/TestFlight/TestFlight.js
@@ -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);
-
-};

0 comments on commit 693332a

Please sign in to comment.
Something went wrong with that request. Please try again.