Comments (7)
The problem is: UIDocumentInteractionController relies on local files. You coukd try to create temporary files, by donwloading the files you want to export from the internet. Than open the TTOpenInAppActivity, afterwards you can delete the temporary files.
from ttopeninappactivity.
Thanks @honkmaster ;)
from ttopeninappactivity.
Another notice: You don`t have to use nsdata as activity item. You just have to use a NSURL-Object pointing to a local file.
from ttopeninappactivity.
Thanks @honkmaster I discover later ;), I've to implement then a cache system downloading locally files cleaning them with care :)
from ttopeninappactivity.
Maybe you can help me @honkmaster , I'm trying to do the way you comment but the app crash and I don't know why because I don't get any error in console. That's the code:
//Generating activities
TTOpenInAppActivity *openInAppActivity = [[TTOpenInAppActivity alloc] initWithView:self.view andRect:self.view.frame];
[activities addObject:openInAppActivity];
TUSafariActivity *safari = [[TUSafariActivity alloc] init];
[activities addObject:safari];
ARChromeActivity *chromeActivity = [[ARChromeActivity alloc] init];
[activities addObject:chromeActivity];
// Generating and presentin UIActivity
if([NSData dataWithContentsOfFile:upload.path]){
//We've the data locally
UIActivityViewController *activityViewController= [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:upload.path]] applicationActivities:activities];
//openInAppActivity.superViewController = activityViewController;
[self.navigationController presentViewController:activityViewController animated:YES completion:NULL];
}else{
//We've to download
[SVProgressHUD show];
[upload downloadData:^(float progress) {
if(progress==1.0){
[SVProgressHUD dismiss];
UIActivityViewController *activityViewController= [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:upload.path]] applicationActivities:activities];
//openInAppActivity.superViewController = activityViewController;
[self.navigationController presentViewController:activityViewController animated:YES completion:NULL];
}
} withErrorBlock:^(NSError *error) {
[SVProgressHUD showErrorWithStatus:NSLocalizedString(@"Error loading attachment", nil)];
}];
}
And from console I don't receive any kind of error. It's strange
from ttopeninappactivity.
Maybe you have to use fileURLwithPath (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html#//apple_ref/occ/clm/NSURL/fileURLWithPath:) ....
from ttopeninappactivity.
Sure @honkmaster , I discovered
from ttopeninappactivity.
Related Issues (20)
- Using TTOpenInAppActivity for Calex HOT 5
- Using TTOpenInActivity in SyncSpace and SketchTo
- Using TTOpenInAppActivity in deGeo
- Using TTOpenInAppActivity in My Wonderful Days
- Swift-Support
- Using TTOpenInAppActivity in Name2Brain and Name2Brain Free
- iOS 8 GM Support HOT 4
- setCompletionWithItemsHandler called when tapping on "More" button in iPad popover controller HOT 2
- IOS 7 not working
- IOS 7 Image not setting up correctly HOT 1
- Build Error ! HOT 2
- Custom Provider HOT 1
- Publish 1.1 to Cocoapods HOT 1
- Listen Cancel button Event HOT 1
- Example-project leaks instances of TTOpenInAppActivity HOT 2
- WriteDown using TTOpenInAppActivity HOT 2
- Incompatibility with relative urls HOT 1
- activityDidFinish when there are no apps to open file HOT 1
- Please add semantic version tags HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttopeninappactivity.