Merge lp:~threeve/ubuntuone-ios-files/testflight-sdk into lp:~urbanape/ubuntuone-ios-files/auto-uploads-view

Proposed by Jason Foreman
Status: Merged
Approved by: Zachery Bir
Approved revision: 61
Merged at revision: 60
Proposed branch: lp:~threeve/ubuntuone-ios-files/testflight-sdk
Merge into: lp:~urbanape/ubuntuone-ios-files/auto-uploads-view
Diff against target: 457 lines (+324/-2)
7 files modified
.bzrignore (+1/-0)
Dependencies/TestFlightSDK/README.txt (+167/-0)
Dependencies/TestFlightSDK/TestFlight.h (+44/-0)
Dependencies/TestFlightSDK/release_notes.txt (+41/-0)
Files.xcodeproj/project.pbxproj (+43/-0)
Files/Files-Prefix.pch (+5/-2)
Files/FilesAppDelegate.m (+23/-0)
To merge this branch: bzr merge lp:~threeve/ubuntuone-ios-files/testflight-sdk
Reviewer Review Type Date Requested Status
Zachery Bir Approve
Review via email: mp+79697@code.launchpad.net

Description of the change

Added TestFlight SDK

To post a comment you must log in.
Revision history for this message
Zachery Bir (urbanape) wrote :

Looks good to me. I'll merge it into my branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-07-18 16:25:02 +0000
3+++ .bzrignore 2011-10-18 14:51:15 +0000
4@@ -5,3 +5,4 @@
5 Files.xcodeproj/*.mode1v3
6 Files.xcodeproj/xcuserdata
7 Files.xcodeproj/project.xcworkspace/
8+U1TestFlightTeamToken.txt
9
10=== added directory 'Dependencies/TestFlightSDK'
11=== added file 'Dependencies/TestFlightSDK/README.txt'
12--- Dependencies/TestFlightSDK/README.txt 1970-01-01 00:00:00 +0000
13+++ Dependencies/TestFlightSDK/README.txt 2011-10-18 14:51:15 +0000
14@@ -0,0 +1,167 @@
15+Thanks for downloading the TestFlight SDK 0.7!
16+
17+This document is also available on the web at https://www.testflightapp.com/sdk/doc
18+
19+1. Why use the TestFlight SDK?
20+2. Considerations
21+3. How do I integrate the SDK into my project?
22+4. Using the Checkpoint API
23+5. Using the Feedback API
24+6. Upload your build
25+7. Questions API
26+8. View your results
27+9. Advanced Exception Handling
28+
29+START
30+
31+
32+1. Why use the TestFlight SDK?
33+
34+The TestFlight SDK allows you to track how beta testers are testing your application. Out of the box we track simple usage information, such as which tester is using your application, their device model/OS, how long they used the application, logs of their test session, and automatic recording of any crashes they encounter.
35+
36+To get the most out of the SDK we have provided the Checkpoint API.
37+
38+The Checkpoint API is used to help you track exactly how your testers are using your application. Curious about which users passed level 5 in your game, or posted their high score to Twitter, or found that obscure feature? With a single line of code you can finally gather all this information. Wondering how many times your app has crashed? Wondering who your power testers are? We've got you covered. See more information on the Checkpoint API in section 4.
39+
40+Alongside the Checkpoint API is the Questions interface. The Questions interface is managed on a per build basis on the TestFlight website. Find out more about the Questions Interface in section 6.
41+
42+2. Considerations
43+
44+
45+Information gathered by the SDK is sent to the website in real time. When an application is put into the background (iOS 4.x) or terminated (iOS 3.x) we try to send the finalizing information for the session during the time allowed for finalizing the application. Should all of the data not get sent the remaining data will be sent the next time the application is launched. As such, to get the most out of the SDK we recommend your application support iOS 4.0 and higher.
46+
47+This SDK can be run from both the iPhone Simulator and Device and has been tested using Xcode 4.0.
48+
49+3. How do I integrate the SDK into my project?
50+
51+
52+1. Add the files to your project: Project -> Add to Project -> TestFlightSDK
53+
54+ 1. Copy items into destination folder (if needed): Checked
55+ 2. Reference Type: Default
56+ 3. Recursively create groups for added folders
57+
58+2. Verify that libTestFlight.a has been added to the Link Binary With Libraries Build Phase for the targets you want to use the SDK with
59+
60+ 1. Select your Project in the Project Navigator
61+ 2. Select the target you want to enable the SDK for
62+ 3. Select the Build Phases tab
63+ 4. Open the Link Binary With Libraries Phase
64+ 5. If libTestFlight.a is not listed, drag and drop the library from your Project Navigator to the Link Binary With Libraries area
65+ 6. Repeat Steps 2 - 5 until all targets you want to use the SDK with have the SDK linked
66+
67+3. In your Application Delegate:
68+
69+ 1. Import TestFlight: `#import "TestFlight.h"`
70+ NOTE: If you do not want to import TestFlight.h in every file you may add the above line into you pre-compiled header (`<projectname>_Prefix.pch`) file inside of the
71+
72+ #ifdef __OBJC__ section.
73+ This will give you access to the SDK across all files.
74+
75+ 2. Get your Team Token which you can find at [http://testflightapp.com/dashboard/team/](http://testflightapp.com/dashboard/team/) select the team you are using from the team selection drop down list on the top of the page and then select edit.
76+
77+
78+ 3. Launch TestFlight with your Team Token
79+
80+ -(BOOL)application:(UIApplication *)application
81+ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
82+ // start of your application:didFinishLaunchingWithOptions
83+ // ...
84+ [TestFlight takeOff:@"Insert your Team Token here"];
85+ // The rest of your application:didFinishLaunchingWithOptions method
86+ // ...
87+ }
88+
89+ 4. To report crashes to you we install our own uncaught exception handler. If you are not currently using an exception handler of your own then all you need to do is go to the next step. If you currently use an Exception Handler, or you use another framework that does please go to the section on advanced exception handling.
90+
91+4. To enable the best crash reporting possible we recommend setting the following project build settings in Xcode to NO for all targets that you want to have live crash reporting for You can find build settings by opening the Project Navigator (default command+1 or command+shift+j) then clicking on the project you are configuring (usually the first selection in the list). From there you can choose to either change the global project settings or settings on an individual project basis. All settings below are in the Deployment Section.
92+
93+ 1. Deployment Post Processing
94+ 2. Strip Debug Symbols During Copy
95+ 3. Strip Linked Product
96+
97+4. Use the Checkpoint API to create important checkpoints throughout your application.
98+
99+When a tester passes a level, or adds a new todo item, you can pass a checkpoint. The checkpoint progress is used to provide insight into how your testers are testing your apps. The passed checkpoints are also attached to crashes, which can help when creating steps to replicate.
100+
101+`[TestFlight passCheckpoint:@"CHECKPOINT_NAME"];`
102+Use `passCheckpoint:` to track when a user performs certain tasks in your application. This can be useful for making sure testers are hitting all parts of your application, as well as tracking which testers are being thorough.
103+
104+5. Using the Feedback API
105+
106+To launch unguided feedback call the `openFeedbackView` method. We recommend that you call this from a GUI element.
107+
108+ -(IBAction)launchFeedback {
109+ [TestFlight openFeedbackView];
110+ }
111+
112+Once users have submitted feedback from inside of the application you can view it in the feedback area of your build page.
113+
114+6. Upload your build.
115+
116+After you have integrated the SDK into your application you need to upload your build to TestFlight. You can upload from your dashboard or or using the Upload API, full documentation at <https://testflightapp.com/api/doc/>
117+
118+7. Add Questions to Checkpoints
119+
120+In order to ask a question, you'll need to associate it with a checkpoint. Make sure your checkpoints are initialized by running your app and hitting them all yourself before you start adding questions.
121+
122+There are three question types available: Yes/No, Multiple Choice, and Long Answer.
123+
124+To create questions, visit your builds Questions page and click on 'Add Question'. If you choose Multiple Choice, you'll need to enter a list of possible answers for your testers to choose from &mdash; otherwise, you'll only need to enter your question's, well, question. If your build has no questions, you can also choose to migrate questions from another build (because seriously &mdash; who wants to do all that typing again)?
125+
126+After restarting your application on an approved device, when you pass the checkpoint associated with your questions a Test Flight modal question form will appear on the screen asking the beta tester to answer your question.
127+
128+After you upload a new build to TestFlight you will need to associate questions once again. However if your checkpoints and questions have remained the same you can choose "copy questions from an older build" and choose which build to copy the questions from.
129+
130+8. View your results.
131+
132+As testers install your build and start to test it you will see their session data on the web on the build report page for the build you've uploaded.
133+
134+9. Advanced Exception Handling
135+
136+An uncaught exception means that your application is in an unknown state and there is not much that you can do but try and exit gracefully. Our SDK does its best to get the data we collect in this situation to you while it is crashing, but it is designed in such a way that the important act of saving the data occurs in as safe way a way as possible before trying to send anything. If you do use uncaught exception or signal handlers install your handlers before calling `takeOff`. Our SDK will then call your handler while ours is running. For example:
137+
138+ /*
139+ My Apps Custom uncaught exception catcher, we do special stuff here, and TestFlight takes care of the rest
140+ **/
141+ void HandleExceptions(NSException *exception) {
142+ NSLog(@"This is where we save the application data during a exception");
143+ // Save application data on crash
144+ }
145+ /*
146+ My Apps Custom signal catcher, we do special stuff here, and TestFlight takes care of the rest
147+ **/
148+ void SignalHandler(int sig) {
149+ NSLog(@"This is where we save the application data during a signal");
150+ // Save application data on crash
151+ }
152+
153+ -(BOOL)application:(UIApplication *)application
154+ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
155+ // installs HandleExceptions as the Uncaught Exception Handler
156+ NSSetUncaughtExceptionHandler(&HandleExceptions);
157+ // create the signal action structure
158+ struct sigaction newSignalAction;
159+ // initialize the signal action structure
160+ memset(&newSignalAction, 0, sizeof(newSignalAction));
161+ // set SignalHandler as the handler in the signal action structure
162+ newSignalAction.sa_handler = &SignalHandler;
163+ // set SignalHandler as the handlers for SIGABRT, SIGILL and SIGBUS
164+ sigaction(SIGABRT, &newSignalAction, NULL);
165+ sigaction(SIGILL, &newSignalAction, NULL);
166+ sigaction(SIGBUS, &newSignalAction, NULL);
167+ // Call takeOff after install your own unhandled exception and signal handlers
168+ [TestFlight takeOff:@"Insert your Team Token here"];
169+ // continue with your application initialization
170+ }
171+
172+You do not need to add the above code if your application does not use exception handling already.
173+
174+END
175+
176+Please contact us if you have any questions.
177+
178+The TestFlight Team
179+
180+w. http://www.testflightapp.com
181+e. beta@testflightapp.com
182
183=== added file 'Dependencies/TestFlightSDK/TestFlight.h'
184--- Dependencies/TestFlightSDK/TestFlight.h 1970-01-01 00:00:00 +0000
185+++ Dependencies/TestFlightSDK/TestFlight.h 2011-10-18 14:51:15 +0000
186@@ -0,0 +1,44 @@
187+//
188+// TestFlight.h
189+// libTestFlight
190+//
191+// Created by Jonathan Janzen on 06/11/11.
192+// Copyright 2011 TestFlight. All rights reserved.
193+
194+#import <Foundation/Foundation.h>
195+#define TESTFLIGHT_SDK_VERSION @"0.7.2"
196+
197+@interface TestFlight : NSObject {
198+
199+}
200+
201+/**
202+ Add custom environment information
203+ If you want to track a user name from your application you can add it here
204+ */
205++ (void)addCustomEnvironmentInformation:(NSString *)information forKey:(NSString*)key;
206+
207+/**
208+ Starts a TestFlight session
209+ */
210++ (void)takeOff:(NSString *)teamToken;
211+
212+/**
213+ Sets custom options
214+ Option Accepted Values Description
215+ reinstallCrashHandlers [NSNumber numberWithBool:YES] Reinstalls crash handlers, to be used if a third party
216+ library installs crash handlers overtop of the TestFlight Crash Handlers
217+ */
218++ (void)setOptions:(NSDictionary*)options;
219+
220+/**
221+ Track when a user has passed a checkpoint after the flight has taken off. Eg. passed level 1, posted high score
222+ */
223++ (void)passCheckpoint:(NSString *)checkpointName;
224+
225+/**
226+ Opens a feeback window that is not attached to a checkpoint
227+ */
228++ (void)openFeedbackView;
229+
230+@end
231
232=== added file 'Dependencies/TestFlightSDK/release_notes.txt'
233--- Dependencies/TestFlightSDK/release_notes.txt 1970-01-01 00:00:00 +0000
234+++ Dependencies/TestFlightSDK/release_notes.txt 2011-10-18 14:51:15 +0000
235@@ -0,0 +1,41 @@
236+0.7.2 - September 29, 2011
237+Changed TESTFLIGHT_SDK_VERSION string to be an NSString
238+Fixed an issue where exiting an application while the SDK is active caused modal views to be dismissed
239+0.7.1 - September 22, 2011
240+Internal release
241+Refactoring
242+0.7 - September 21, 2011
243+Moved TestFlight images and data to the Library/Caches folder
244+Resolved an issue where sometimes the rootViewController could not be found and feedback, questions and upgrade views would not be displayed
245+In application upgrade changed to allow skipping until the next version is installed and allows upgrades to be forced
246+Fixed a memory leak when launching questions
247+0.6 - September 2, 2011
248+Renamed base64_encode to testflight_base64_encode to remove a conflict with other third party libraries
249+Added ability to reinstall crash handlers when they are overwritten using the setOptions API
250+Fixed an issue where crash reports might not get sent under certain circumstances
251+Fixed a deadlock when the application is put in the background and then resumed before all information can be sent
252+Fixed an issue when attempting to un-install all signal handlers during a signal
253+Added support for landscape mode on the iPad to the Questions and Feedback views
254+Crash reporting now works in versions of Xcode earlier than 4.2
255+Fixed a memory leak during handshake
256+0.5 - August 19, 2011
257+Feedback that is not attached to a checkpoint [TestFlight openFeedbackView]
258+Usability changes to question views
259+Removed pause and resume sessions, replaced with sessions being stopped and started
260+Added text auto correction to the Long Answer question type
261+Crash reports now send on crash instead of next launch
262+0.4 - August 15, 2011
263+In Application Feedback with Questions
264+In application updates
265+Custom Environment Information added
266+Networking stack reimplementation
267+Exception handling fixes
268+0.3 - June 15, 2011
269+Removed all mention of JSONKit from the README
270+Added support for using both the Bundle Version and the Bundle Short Version string
271+0.2 - June 14, 2011
272+Removed all categories this allows users to use the SDK without having to set -ObjC and -load_all
273+Prefixed JSONKit for use in TestFlight to remove reported issues where some users were already using JSONKit
274+Added support for armv6 again
275+0.1 - June 11, 2011
276+Initial Version
277\ No newline at end of file
278
279=== modified file 'Files.xcodeproj/project.pbxproj'
280--- Files.xcodeproj/project.pbxproj 2011-10-12 21:04:55 +0000
281+++ Files.xcodeproj/project.pbxproj 2011-10-18 14:51:15 +0000
282@@ -28,6 +28,7 @@
283 960D462E140DD22800B73177 /* U1FileNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 960D462D140DD22600B73177 /* U1FileNode.m */; };
284 960D4631140DD23600B73177 /* U1FolderNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 960D4630140DD23400B73177 /* U1FolderNode.m */; };
285 960D4635140DDBE400B73177 /* U1NodeChildrenResultSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 960D4634140DDBE400B73177 /* U1NodeChildrenResultSet.m */; };
286+ 963C16D0144346CC007A51D0 /* libTestFlight.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 963C16CB144346A6007A51D0 /* libTestFlight.a */; };
287 965D7EA814293B6700E4754F /* ic_act_publish_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 965D7EA214293B6700E4754F /* ic_act_publish_file.png */; };
288 965D7EA914293B6700E4754F /* ic_act_publish_file@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 965D7EA314293B6700E4754F /* ic_act_publish_file@2x.png */; };
289 965D7EAA14293B6700E4754F /* ic_act_unpublish_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 965D7EA414293B6700E4754F /* ic_act_unpublish_file.png */; };
290@@ -168,6 +169,11 @@
291 960D4630140DD23400B73177 /* U1FolderNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1FolderNode.m; sourceTree = "<group>"; };
292 960D4633140DDBE400B73177 /* U1NodeChildrenResultSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1NodeChildrenResultSet.h; sourceTree = "<group>"; };
293 960D4634140DDBE400B73177 /* U1NodeChildrenResultSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1NodeChildrenResultSet.m; sourceTree = "<group>"; };
294+ 963C16CB144346A6007A51D0 /* libTestFlight.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFlight.a; sourceTree = "<group>"; };
295+ 963C16CC144346A6007A51D0 /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
296+ 963C16CD144346A6007A51D0 /* release_notes.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = release_notes.txt; sourceTree = "<group>"; };
297+ 963C16CE144346A6007A51D0 /* TestFlight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestFlight.h; sourceTree = "<group>"; };
298+ 963C16D1144349D2007A51D0 /* U1TestFlightTeamToken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = U1TestFlightTeamToken.h; sourceTree = "<group>"; };
299 965D7EA214293B6700E4754F /* ic_act_publish_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_act_publish_file.png; path = Assets/ic_act_publish_file.png; sourceTree = "<group>"; };
300 965D7EA314293B6700E4754F /* ic_act_publish_file@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ic_act_publish_file@2x.png"; path = "Assets/ic_act_publish_file@2x.png"; sourceTree = "<group>"; };
301 965D7EA414293B6700E4754F /* ic_act_unpublish_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_act_unpublish_file.png; path = Assets/ic_act_unpublish_file.png; sourceTree = "<group>"; };
302@@ -320,6 +326,7 @@
303 96E860B613F7251D0026783D /* UIKit.framework in Frameworks */,
304 96E860B813F7251D0026783D /* Foundation.framework in Frameworks */,
305 96E860BA13F7251D0026783D /* CoreGraphics.framework in Frameworks */,
306+ 963C16D0144346CC007A51D0 /* libTestFlight.a in Frameworks */,
307 );
308 runOnlyForDeploymentPostprocessing = 0;
309 };
310@@ -389,6 +396,17 @@
311 name = Model;
312 sourceTree = "<group>";
313 };
314+ 963C16CA144346A6007A51D0 /* TestFlightSDK */ = {
315+ isa = PBXGroup;
316+ children = (
317+ 963C16CB144346A6007A51D0 /* libTestFlight.a */,
318+ 963C16CC144346A6007A51D0 /* README.txt */,
319+ 963C16CD144346A6007A51D0 /* release_notes.txt */,
320+ 963C16CE144346A6007A51D0 /* TestFlight.h */,
321+ );
322+ path = TestFlightSDK;
323+ sourceTree = "<group>";
324+ };
325 96733AEC140DFABB0074D545 /* SSO */ = {
326 isa = PBXGroup;
327 children = (
328@@ -562,6 +580,7 @@
329 96E860C313F7251D0026783D /* Files-Prefix.pch */,
330 96733B13140E04940074D545 /* UIActionSheet+U1Additions.h */,
331 96733B14140E04940074D545 /* UIActionSheet+U1Additions.m */,
332+ 963C16D1144349D2007A51D0 /* U1TestFlightTeamToken.h */,
333 );
334 name = "Supporting Files";
335 sourceTree = "<group>";
336@@ -588,6 +607,7 @@
337 96E860F413F726250026783D /* Dependencies */ = {
338 isa = PBXGroup;
339 children = (
340+ 963C16CA144346A6007A51D0 /* TestFlightSDK */,
341 96E8614713F740E20026783D /* JSONKit */,
342 96E860F513F7265B0026783D /* oauthconsumer */,
343 960D45F91409E09F00B73177 /* PullToRefresh */,
344@@ -678,6 +698,7 @@
345 buildPhases = (
346 96E860AD13F7251D0026783D /* Sources */,
347 96E860AE13F7251D0026783D /* Frameworks */,
348+ 963C16D614437CF4007A51D0 /* ShellScript */,
349 96E860AF13F7251D0026783D /* Resources */,
350 );
351 buildRules = (
352@@ -777,6 +798,20 @@
353 /* End PBXResourcesBuildPhase section */
354
355 /* Begin PBXShellScriptBuildPhase section */
356+ 963C16D614437CF4007A51D0 /* ShellScript */ = {
357+ isa = PBXShellScriptBuildPhase;
358+ buildActionMask = 2147483647;
359+ files = (
360+ );
361+ inputPaths = (
362+ );
363+ outputPaths = (
364+ );
365+ runOnlyForDeploymentPostprocessing = 0;
366+ shellPath = /bin/bash;
367+ shellScript = "\nif [ -f ${SRCROOT}/U1TestFlightTeamToken.txt ]\nthen\n\ncp ${SRCROOT}/U1TestFlightTeamToken.txt ${CODESIGNING_FOLDER_PATH}\n\nelse \n\necho \"warning: ${SRCROOT}/U1TestFlightTeamToken.txt does not exist. Create this file and paste the Ubuntu One TestFlight team token into it to enable TestFlight SDK analytics.\"\n\nfi\n\n\n#echo \"foo\" > ${CODESIGNING_FOLDER_PATH}/foo.plist\n";
368+ showEnvVarsInLog = 0;
369+ };
370 96E860D813F7251D0026783D /* ShellScript */ = {
371 isa = PBXShellScriptBuildPhase;
372 buildActionMask = 2147483647;
373@@ -970,6 +1005,10 @@
374 GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
375 INFOPLIST_FILE = "Files/Files-Info.plist";
376 IPHONEOS_DEPLOYMENT_TARGET = 4.0;
377+ LIBRARY_SEARCH_PATHS = (
378+ "$(inherited)",
379+ "\"$(SRCROOT)/Dependencies/TestFlightSDK\"",
380+ );
381 PRODUCT_NAME = "$(TARGET_NAME)";
382 "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
383 TARGETED_DEVICE_FAMILY = 1;
384@@ -988,6 +1027,10 @@
385 GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
386 INFOPLIST_FILE = "Files/Files-Info.plist";
387 IPHONEOS_DEPLOYMENT_TARGET = 4.0;
388+ LIBRARY_SEARCH_PATHS = (
389+ "$(inherited)",
390+ "\"$(SRCROOT)/Dependencies/TestFlightSDK\"",
391+ );
392 PRODUCT_NAME = "$(TARGET_NAME)";
393 "PROVISIONING_PROFILE[sdk=iphoneos*]" = "6B9A800B-4788-4085-B843-B668F6308C89";
394 TARGETED_DEVICE_FAMILY = 1;
395
396=== modified file 'Files/Files-Prefix.pch'
397--- Files/Files-Prefix.pch 2011-08-31 14:56:30 +0000
398+++ Files/Files-Prefix.pch 2011-10-18 14:51:15 +0000
399@@ -20,6 +20,9 @@
400 #endif
401
402 #ifdef __OBJC__
403- #import <UIKit/UIKit.h>
404- #import <Foundation/Foundation.h>
405+
406+#import <UIKit/UIKit.h>
407+#import <Foundation/Foundation.h>
408+#import "TestFlight.h"
409+
410 #endif
411
412=== modified file 'Files/FilesAppDelegate.m'
413--- Files/FilesAppDelegate.m 2011-10-12 21:02:22 +0000
414+++ Files/FilesAppDelegate.m 2011-10-18 14:51:15 +0000
415@@ -46,6 +46,7 @@
416 - (void)ensureUploadFolder;
417 - (NSString*)remoteUploadFolderPath;
418 - (NSString*)localUploadQueuePath;
419+- (void)prepareTestFlight;
420 @end
421
422
423@@ -68,6 +69,8 @@
424
425 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
426 {
427+ [self prepareTestFlight];
428+
429 [self.window makeKeyAndVisible];
430
431 return YES;
432@@ -183,6 +186,26 @@
433 [self applicationDidBecomeActive:nil];
434 }
435
436+- (void)prepareTestFlight;
437+{
438+ NSString *tokenFilePath = [[NSBundle mainBundle] pathForResource:@"U1TestFlightTeamToken" ofType:@"txt"];
439+ if (!tokenFilePath)
440+ return;
441+
442+ NSError *error = nil;
443+ NSString *teamToken = [NSString stringWithContentsOfFile:tokenFilePath usedEncoding:NULL error:&error];
444+
445+ if (teamToken)
446+ {
447+ teamToken = [teamToken stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
448+ [TestFlight takeOff:teamToken];
449+ }
450+ else
451+ {
452+ NSLog(@"error loading TestFlight team token: %@", error);
453+ }
454+}
455+
456
457 #pragma mark U1FolderViewControllerDelegate Methods
458

Subscribers

People subscribed via source and target branches

to all changes: