Skip to content
This repository was archived by the owner on Apr 25, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions AUTHORS

This file was deleted.

7 changes: 7 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Authors
=======

* Russell Cohen - @rcoh
* Liyan David Chang - @liyanchang
* Brett van Zuiden - @brettcvz
* Darko Vukovic - @darkman17
6 changes: 3 additions & 3 deletions Classes/FileSourceListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import <INK/Ink.h>
#import "FPSampleSourceController.h"
#import "ThatCloudConstants.h"
#import "StandaloneStatsEmitter.h"

#import "FlatUIKit.h"

Expand Down Expand Up @@ -371,9 +372,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
index--;
NSString *sourceCategory = [[self.sources allKeys] objectAtIndex:indexPath.section];
FPSource *source = [[self.sources valueForKey:sourceCategory] objectAtIndex:index];

//NSLog(@"Source %@", source);


[[StandaloneStatsEmitter sharedEmitter] sendStat:@"source_selected" withAdditionalStatistics:@{@"source": source.name}];

FileSourceController *sView;
if ([fpdelegate class] == [SourceListSaveController class]){
Expand Down
16 changes: 16 additions & 0 deletions Classes/StandaloneStatsEmitter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// StatsEmitter.h
// INK
//
// Created by Russell Cohen on 9/4/13.
// Copyright (c) 2013 Computer Club. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface StandaloneStatsEmitter : NSObject<NSURLConnectionDelegate>

+ (StandaloneStatsEmitter *)sharedEmitter;
- (void) sendStat: (NSString *)actionType withAdditionalStatistics:(NSDictionary *)additonalStatistics;
- (void) setAppKey: (NSString *)_appKey;

@end
93 changes: 93 additions & 0 deletions Classes/StandaloneStatsEmitter.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
//
// StatsEmitter.m
// INK
//
// Created by Russell Cohen on 9/4/13.
// Copyright (c) 2013 Ink (Cloudtop Inc.) All rights reserved.
//

#import "StandaloneStatsEmitter.h"

#define ink_STATSURL @"https://www.example.com/"
#define WARNING(...) NSLog(__VA_ARGS__); assert(false);
#define REQUIRED_KEYS @[@"Stat_Action_Type", @"Originating_App", @"Device_ID", @"Device_Type"]

@implementation StandaloneStatsEmitter {
NSString *_appKey;
NSMutableData *_responseData;
}

+ (StandaloneStatsEmitter *)sharedEmitter {

static StandaloneStatsEmitter *_sharedEmitter = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedEmitter = [[StandaloneStatsEmitter alloc] init];

});

return _sharedEmitter;
}

- (void) setAppKey: (NSString *)appKey {
_appKey = appKey;
}

- (id)init:(NSURL *)url {
self = [super init];
if (!self) {
return nil;
}

return self;
}
- (NSDictionary *) addCoreDictionaryTo: (NSDictionary *)stat withActionType: (NSString *)actionType {
NSMutableDictionary *statParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[[[UIDevice currentDevice] identifierForVendor] UUIDString], @"Device_ID",
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"], @"Originating_App",
[UIDevice currentDevice].model, @"Device_Type",
[UIDevice currentDevice].systemVersion, @"OS_Version",
actionType, @"Stat_Action_Type",
nil];
[statParams addEntriesFromDictionary:stat];
return [NSDictionary dictionaryWithDictionary:statParams];
}

- (void) sendDictionary: (NSDictionary *)stat {
#ifndef DEBUG
NSURL *url = [NSURL URLWithString:ink_STATSURL];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

NSError *error = [[NSError alloc] init];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:stat options:0 error:&error];
if (jsonData) {
[request setHTTPBody:jsonData];
} else {
NSLog(@"Unable to serialize the data %@: %@", stat, error);
}
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *resp, NSData *data, NSError *err) {
NSHTTPURLResponse *resphttp = (NSHTTPURLResponse *)resp;
NSLog(@"woo: %d", [resphttp statusCode]);
}];
#else
NSLog(@"Mock stat: %@", stat);
#endif
}

- (void) sendStat: (NSString *)actionType withAdditionalStatistics:(NSDictionary *)additonalStatistics {
if (_appKey == nil) {
WARNING(@"App key is nil in stats emitter");
}
NSDictionary *finalDict = [self addCoreDictionaryTo:additonalStatistics withActionType:actionType];
for(id key in REQUIRED_KEYS) {
if ([finalDict objectForKey:key] == nil) {
WARNING(@"Required parameter: %@ not found in stats dict: %@", key, finalDict);
}
}
[self sendDictionary:finalDict];
}

@end
6 changes: 5 additions & 1 deletion Classes/ThatCloudAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "FPPicker.h"
#import "INKWelcomeViewController.h"
#import "ATConnect.h"
#import "StandaloneStatsEmitter.h"

#define kApptentiveAPIKey @"2f565a4292b7381c91028235e59b70dc20616c503690982e1adb25d68637d89c"

Expand All @@ -23,13 +24,16 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

// Initialize Ink
[Ink setupWithAppKey:@"AneRowxpcloudAGkdngz"];

[[StandaloneStatsEmitter sharedEmitter] setAppKey:@"AneRowxpcloudAGkdngz"];
[[StandaloneStatsEmitter sharedEmitter] sendStat:@"app_launched" withAdditionalStatistics:nil];
[[INKCoreManager sharedManager] registerAdditionalURLScheme:@"thatcloud"];

// Register our incoming actions
INKAction *store = [INKAction action:@"Store in ThatCloud" type:INKActionType_Store];
[Ink registerAction:store withTarget:self selector:@selector(storeBlob:action:error:)];

INKAction *storeFacebook = [INKAction action:@"Post in Facebook" type:INKActionType_Share];
INKAction *storeFacebook = [INKAction action:@"Post to Facebook" type:INKActionType_Share];
[Ink registerAction:storeFacebook withTarget:self selector:@selector(storeToFacebook:action:error:)];

INKAction *storeDropbox = [INKAction action:@"Store in Dropbox" type:INKActionType_Insert];
Expand Down
10 changes: 5 additions & 5 deletions Classes/thatcloud-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -61,7 +61,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1</string>
<string>1.3</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand All @@ -85,11 +85,11 @@
<key>TintColor</key>
<dict>
<key>Blue</key>
<real>0.8745098039215686</real>
<real>0.87450980392156863</real>
<key>Green</key>
<real>0.4784313725490196</real>
<real>0.47843137254901957</real>
<key>Red</key>
<real>0</real>
<real>0.0</real>
</dict>
<key>Translucent</key>
<false/>
Expand Down
66 changes: 49 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ThatCloud
ThatCloud [![App Store](http://linkmaker.itunes.apple.com/htmlResources/assets/en_us//images/web/linkmaker/badge_appstore-lrg.png)](https://itunes.apple.com/app/id681023311)
=========

ThatCloud is an open-source iOS application built by [Ink](www.inkmobility.com) that helps you Get Work Done. No more saving work until you get back to your desk - with ThatCloud, you can get it done on the go.
ThatCloud is an iOS app that integrates all your cloud storage services so you get work done. No more saving work until you get back to your desk - with ThatCloud, you can get it done on the go.

ThatCloud integrates with all of your favorites sources of content, from Dropbox and Box to Gmail attachments and Instagram photos. By offering a single place for you to access, view, and work with all of your content, ThatCloud helps simplify your workflow and enhances your iPad productivity.

Expand All @@ -14,38 +14,70 @@ A few ThatCloud features:

With ThatCloud, the iPad is a full-blown productivity device - you no longer need to worry about not having a filesystem on your iPad. The full list of features is detailed in our [blog post](http://blog.inkmobility.com/post/58830177894/introducing-thatcloud-your-portal-to-your-cloud).

ThatCloud is also currently available on the [App Store](https://itunes.apple.com/us/app/thatcloud/id681023311?mt=8)
ThatCloud is also currently available on the [App Store](https://itunes.apple.com/app/id681023311)
![ThatCloud in action](https://s3.amazonaws.com/your_own_bucket/Cq4qJEoAQmWLSZXbKedw_awesome)

Ink Integration Details
=======================
The Ink Mobile framework transforms ThatCloud from a simple file preview to a full platform to interact with your content. ThatCloud integrates with Ink in two locations:
License
-------
ThatPDF is an open-source iOS application built by [Ink](www.inkmobility.com), released under the MIT License. You are welcome to fork this app, and pull requests are always encouraged.

How To Contribute
-------------------------
Glad you asked! ThatCloud is based on the [Git flow](http://nvie.com/posts/a-successful-git-branching-model/) development model, so to contribute, please make sure that you follow the git flow branching methodology.

Currently ThatCloud supports iOS6 on iPads. Make sure that your code runs in both the simulator and on an actual device for this environment.

1. ThatCloudAppDelegate registers incoming actions and provides their handlers.
2. FilePreviewViewController enables the file preview view to transmit content to other Ink enabled apps.
Once you have your feature, improvement, or bugfix, submit a pull request, and we'll take a look and merge it in. We're very encouraging of adding new owners to the repo, so if after a few pull requests you want admin access, let us know.

Every other Thursday, we cut a release branch off of develop, build the app, and submit it to the iOS App Store.

If you're looking for something to work on, take a look in the list of issues for this repository. And in your pull request, be sure to add yourself to the readme and authors file as a contributor.

What are the "That" Apps?
=============================
-------------------------

To demonstrate the power Ink mobile framework, Ink created the "ThatApp" suite of sample apps. Along with ThatCloud, there is also ThatInbox for reading your mail, ThatPDF for editing your documents and ThatPhoto for tweaking your photos. But we want the apps to do more than just showcase the Ink Mobile Framework. That's why we're releasing the apps open source.
To demonstrate the power of the Ink mobile framework, Ink created the "ThatApp" suite of sample apps. Along with ThatCloud, there is also ThatInbox for reading your mail, ThatPhoto for editing your photos and ThatPDF for signing and annotating documents. But we want the apps to do more than just showcase the Ink Mobile Framework. That's why we're releasing the apps open source.

As iOS developers we leverage an incredible amount of software created by the community. By releasing these apps, we hope we can make small contribution back. Here's what you can do with these apps:
As iOS developers, we leverage an incredible amount of software created by the community. By releasing these apps, we hope we can make small contribution back. Here's what you can do with these apps:
1. Use them!

They are your apps, and you should be able to do with them what you want. Skin it, fix it, tweak it, improve it. Once you're done, send us a pull request. We build and submit to the app store every other week on Thursdays.

They're your apps and you should be able to do with them what you want. Skin it, fix it, tweak it, improve it. Once you're done, send us a pull request!
2. Get your code to the App Store

2. Get your code to the app store

All of our sample apps are currently in the App store. Developers learning iOS can get their code in the app store without having to write an entire app. They only need to send a pull request.
All of our sample apps are currently in the App Store. If you're just learning iOS, you can get real, production code in the app store without having to write an entire app. Just send us a pull request!

3. Support other iOS Framework companies

The sample apps are a place where other framework companies can integrate their product to show it off to the world, or simply a place to demonstrate integration strategies to your customers.
If you are building iOS developer tools, these apps are a place where you can integrate your product and show it off to the world. They can also serve to demonstrate different integration strategies to your customers.

4. Evaluate potential hires

Want to interview an iOS developer? Test their chops by asking them to add a feature or two a real world app.
Want to interview an iOS developer? Test their chops by asking them to add a feature or two to a real-world app.

5. Show off your skills

Trying to get a job? Point an employer to your merged pull requests to the sample apps as a demonstration of your ability to contribute to real apps.


Ink Integration Details
-----------------------
The Ink Mobile framework transforms ThatCloud from a simple file preview to a full platform to interact with your content. ThatCloud integrates with Ink in two locations:

1. [ThatCloudAppDelegate](https://github.com/Ink/ThatCloud/blob/develop/Classes/ThatCloudAppDelegate.m#L29) registers incoming actions and provides their handlers.
2. [FilePreviewViewController](https://github.com/Ink/ThatCloud/blob/develop/Classes/FilePreviewViewController.m#L121) enables the file preview view to transmit content to other Ink enabled apps.

Contributors
------------
Many thanks to the people who have helped make this app:

* Russell Cohen - [@rcoh](https://github.com/rcoh)
* Liyan David Chang - [@liyanchang](https://github.com/liyanchang)
* Darko Vukovic - [@darkman17](https://github.com/darkman17)
* Brett van Zuiden - [@brettcvz](https://github.com/brettcvz)

Also, the following third-party frameworks are used in this app:

* [Ink iOS Framework](https://github.com/Ink/InkiOSFramework) for connecting to other iOS apps.
* [AFNetworking](https://github.com/AFNetworking/AFNetworking) for communicating with the Ink servers.
* [Apptentive](https://github.com/apptentive/apptentive-ios) for receiving user feedback.
Binary file modified Vendor/INK.bundle/Info.plist
Binary file not shown.
Binary file modified Vendor/INK.bundle/button_pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/button_standard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/help@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/help_highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/help_highlighted@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Vendor/INK.bundle/ink.8-22-13.db.sqlite
Binary file not shown.
Binary file added Vendor/INK.bundle/ink.8-27-13.db.sqlite
Binary file not shown.
Binary file added Vendor/INK.bundle/ink.v0001.db.sqlite
Binary file not shown.
Binary file modified Vendor/INK.bundle/inklogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Vendor/INK.bundle/inklogo@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Vendor/INK.bundle/selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Vendor/INK.bundle/selected2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Vendor/INK.framework/INK
Binary file not shown.
1 change: 1 addition & 0 deletions Vendor/INK.framework/INK
6 changes: 4 additions & 2 deletions Vendor/INK.framework/Versions/A/Headers/INKAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
//Parent app
@property(nonatomic, strong) INKApp *app;

+ (id)action:(NSString *)name type:(NSString *)type;
+ (id)action:(NSString *)name type:(NSString *)type app:(INKApp *)app;
+ (id) actionWithUUID:(NSString *)uuid;

+ (id)action:(NSString *)name type:(NSString *)type __attribute__((deprecated("Use actionWithUUID instead. You can get the UUIDs for your actions from the developer portal. For older actions, don't be suprised that the UUID is the user displayed action name.")));
+ (id)action:(NSString *)name type:(NSString *)type app:(INKApp *)app __attribute__((deprecated("Use actionWithUUID instead. You can get the UUIDs for your actions from the developer portal. For older actions, don't be suprised that the UUID is the user displayed action name.")));

- (BOOL) isReturnAction;
- (BOOL) isErrorAction;
Expand Down
2 changes: 2 additions & 0 deletions Vendor/INK.framework/Versions/A/Headers/INKBlob.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@
// Creates a blob from a file:// url pointing to a file on the device.
+ (INKBlob*)blobFromLocalFile:(NSURL *)source;

- (NSInteger) crcChecksum;

@end
4 changes: 2 additions & 2 deletions Vendor/INK.framework/Versions/A/Headers/INKCoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
@property (strong, atomic) NSString *callbackURLScheme;
@property (readonly,atomic) INKApp *callingApp;
@property (readonly,atomic) NSString *currentRequestId;
@property (readonly,atomic) INKBlob *currentBlob;
@property (readonly, nonatomic) INKBlob *currentBlob;
@property (readonly, atomic) NSInteger blobChecksum;

// RCOH THIS IS REQUIRED FOR BACKWARDS COMPATIBILITY. REMOVO PRONTO.
@property (copy,atomic) INKActionCallbackBlock ios6ReturnBlock;
Expand Down Expand Up @@ -46,7 +47,6 @@

// Returns whether app was launched via ink and this should return in the corresponding way
- (BOOL)appShouldReturn;

- (BOOL)canPerformAction:(INKAction*)action;

//Low-level inter-app communication stuff
Expand Down
2 changes: 2 additions & 0 deletions Vendor/INK.framework/Versions/A/Headers/INKTriple.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
@property(nonatomic, strong) INKBlob *blob;
@property(nonatomic, strong) INKAction *action;
@property(nonatomic, strong) INKUser *user;
@property BOOL useInstallFlowProtocol;


// Instantiates a new triple for the given [Action, Blob, User] set.
+ (id)tripleWithAction:(INKAction *)action blob:(INKBlob *)blob user:(INKUser *)user;
Expand Down
Binary file modified Vendor/INK.framework/Versions/A/INK
Binary file not shown.
Loading