Skip to content
This repository
Browse code

Moved plugin to author's repo.

  • Loading branch information...
commit 693332a0e1397f86e32e5d062ff866c5edf3ddfe 1 parent 42b6e2b
Shazron Abdullah shazron authored
25 iPhone/TestFlight/PGTestFlight.h
... ... @@ -1,25 +0,0 @@
1   -//
2   -// PGTestFlight.h
3   -//
4   -// Created by Shazron Abdullah on 11-09-13.
5   -// Copyright 2011 Nitobi Software Inc. All rights reserved.
6   -//
7   -#ifdef PHONEGAP_FRAMEWORK
8   - #import <PhoneGap/PGPlugin.h>
9   -#else
10   - #import "PGPlugin.h"
11   -#endif
12   -
13   -@interface PGTestFlight : PGPlugin
14   -
15   -- (void)addCustomEnvironmentInformation:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
16   -
17   -- (void)takeOff:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
18   -
19   -- (void)setOptions:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
20   -
21   -- (void)passCheckpoint:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
22   -
23   -- (void)openFeedbackView:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;;
24   -
25   -@end
104 iPhone/TestFlight/PGTestFlight.m
... ... @@ -1,104 +0,0 @@
1   -//
2   -// PGTestFlight.m
3   -//
4   -// Created by Shazron Abdullah on 11-09-13.
5   -// Copyright 2011 Nitobi Software Inc. All rights reserved.
6   -//
7   -
8   -#import "PGTestFlight.h"
9   -#import "TestFlight.h"
10   -
11   -#ifdef PHONEGAP_FRAMEWORK
12   - #import <PhoneGap/PluginResult.h>
13   -#else
14   - #import "PluginResult.h"
15   -#endif
16   -
17   -@implementation PGTestFlight
18   -
19   -- (id)init
20   -{
21   - self = [super init];
22   - if (self) {
23   - // Initialization code here.
24   - }
25   -
26   - return self;
27   -}
28   -
29   -- (void) addCustomEnvironmentInformation:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
30   -{
31   - NSString* callbackId = [arguments pop];
32   - PluginResult* result = nil;
33   -
34   - NSString* key = [options objectForKey:@"key"];
35   - NSString* information = [options objectForKey:@"information"];
36   -
37   - if (key && information) {
38   - [TestFlight addCustomEnvironmentInformation:information forKey:key];
39   - result = [PluginResult resultWithStatus:PGCommandStatus_OK];
40   - [super writeJavascript:[result toSuccessCallbackString:callbackId]];
41   - } else {
42   - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"information or key property is missing."];
43   - [super writeJavascript:[result toErrorCallbackString:callbackId]];
44   - }
45   -}
46   -
47   -- (void) takeOff:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
48   -{
49   - NSString* callbackId = [arguments pop];
50   - PluginResult* result = nil;
51   -
52   - NSString* teamToken = [options objectForKey:@"teamToken"];
53   - if (teamToken) {
54   - [TestFlight takeOff:teamToken];
55   - result = [PluginResult resultWithStatus:PGCommandStatus_OK];
56   - [super writeJavascript:[result toSuccessCallbackString:callbackId]];
57   - } else {
58   - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"teamToken property is missing."];
59   - [super writeJavascript:[result toErrorCallbackString:callbackId]];
60   - }
61   -}
62   -
63   -- (void)setOptions:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
64   -{
65   - NSString* callbackId = [arguments pop];
66   - PluginResult* result = nil;
67   -
68   - if ([options count] > 0) {
69   - [TestFlight setOptions:options];
70   - result = [PluginResult resultWithStatus:PGCommandStatus_OK];
71   - [super writeJavascript:[result toSuccessCallbackString:callbackId]];
72   - } else {
73   - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"options dictionary is empty."];
74   - [super writeJavascript:[result toErrorCallbackString:callbackId]];
75   - }
76   -}
77   -
78   -- (void) passCheckpoint:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
79   -{
80   - NSString* callbackId = [arguments pop];
81   - PluginResult* result = nil;
82   -
83   - NSString* checkpointName = [options objectForKey:@"checkpointName"];
84   - if (checkpointName) {
85   - [TestFlight passCheckpoint:checkpointName];
86   - result = [PluginResult resultWithStatus:PGCommandStatus_OK];
87   - [super writeJavascript:[result toSuccessCallbackString:callbackId]];
88   - } else {
89   - result = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:@"checkpointName property is missing."];
90   - [super writeJavascript:[result toErrorCallbackString:callbackId]];
91   - }
92   -}
93   -
94   -- (void) openFeedbackView:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
95   -{
96   - NSString* callbackId = [arguments pop];
97   -
98   - [TestFlight openFeedbackView];
99   -
100   - PluginResult* result = [PluginResult resultWithStatus:PGCommandStatus_OK];
101   - [super writeJavascript:[result toSuccessCallbackString:callbackId]];
102   -}
103   -
104   -@end
1  iPhone/TestFlight/README.md
Source Rendered
... ... @@ -0,0 +1 @@
  1 +This plugin has been moved to [http://github.com/shazron/TestFlightPlugin](http://github.com/shazron/TestFlightPlugin)
92 iPhone/TestFlight/TestFlight.js
... ... @@ -1,92 +0,0 @@
1   -/*
2   - TestFlight Plugin for PhoneGap.
3   - Created by Shazron Abdullah, Nitobi Software Inc.
4   -
5   - 1. Include the TestFlight SDK files in Xcode (follow their instructions)
6   - 2. Add PGTestFlight.h and .m in Xcode
7   - 3. Add TestFlight.js to your www folder, and reference it in a script tag after your phonegap.js
8   - 4. In PhoneGap.plist, under the 'Plugins' key, add a new row: key is "com.phonegap.testflightsdk" and the value is "PGTestFlight"
9   - 5. In PhoneGap.plist, under the 'ExternalHosts' key, add a new value "testflightapp.com"
10   -
11   - The plugin's JavaScript functions are under the global "window.plugins.TestFlight" object.
12   - See the functions below (and the TestFlight SDK docs) for usage. Unfortunately all of TestFlight's SDK functions return void,
13   - and errors can only be gleaned from the run console, so check that for errors.
14   - */
15   -
16   -if (!PhoneGap.hasResource("TestFlight")) {
17   - PhoneGap.addResource("TestFlight");
18   -
19   -TestFlight = function() {
20   - this.serviceName = "com.phonegap.testflightsdk";
21   -};
22   -
23   -/*
24   - Add custom environment information
25   - If you want to track a user name from your application you can add it here
26   -
27   - @param successCallback function
28   - @param failureCallback function
29   - @param key string
30   - @param information string
31   - */
32   -TestFlight.prototype.addCustomEnvironmentInformation = function(successCallback, failureCallback, key, information) {
33   - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "addCustomEnvironmentInformation",
34   - [{ key: key, information: information }]);
35   -};
36   -
37   -/*
38   - Starts a TestFlight session
39   -
40   - @param successCallback function
41   - @param failureCallback function
42   - @param teamToken string
43   - */
44   -TestFlight.prototype.takeOff = function(successCallback, failureCallback, teamToken) {
45   - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "takeOff", [{ teamToken: teamToken }]);
46   -};
47   -
48   -/*
49   - Sets custom options
50   -
51   - @param successCallback function
52   - @param failureCallback function
53   - @param options object i.e { reinstallCrashHandlers : true }
54   - */
55   -TestFlight.prototype.setOptions = function(successCallback, failureCallback, options) {
56   - if (!(null !== options && 'object' == typeof(options))) {
57   - options = {};
58   - }
59   - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "setOptions", [ options ]);
60   -};
61   -
62   -/*
63   - Track when a user has passed a checkpoint after the flight has taken off. Eg. passed level 1, posted high score
64   -
65   - @param successCallback function
66   - @param failureCallback function
67   - @param checkpointName string
68   - */
69   -TestFlight.prototype.passCheckpoint = function(successCallback, failureCallback, checkpointName) {
70   - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "passCheckpoint", [{ checkpointName: checkpointName }]);
71   -};
72   -
73   -/*
74   - Opens a feeback window that is not attached to a checkpoint
75   -
76   - @param successCallback function
77   - @param failureCallback function
78   - */
79   -TestFlight.prototype.openFeedbackView = function(successCallback, failureCallback) {
80   - PhoneGap.exec(successCallback, failureCallback, this.serviceName, "openFeedbackView", []);
81   -};
82   -
83   -
84   -TestFlight.install = function()
85   -{
86   - if (typeof window.plugins == "undefined") window.plugins = {};
87   - if (typeof window.plugins.TestFlight == "undefined") window.plugins.TestFlight = new TestFlight();
88   -}
89   -
90   -PhoneGap.addConstructor(TestFlight.install);
91   -
92   -};

0 comments on commit 693332a

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