Opening attachments from Mail in iOS4 app
I got how to open attachments in y开发者_如何学Pythonour app from the Mail app here.
But how do I handle this in an iOS4 app? When my app is in the background and I open a file from Mail, -application:didFinishLaunchingWithOptions:
does not fire. -applicationDidBecomeActive
does, but it does not seem to have a way to retrieve the link to the file from there.
Anyone encountered this before? Any additional pointers on pitfalls I have yet to encounter will be very helpful too. Thanks in advance!
This should work:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if ([url isFileURL])
{
NSLog(@"file at path %@", [url path ]);
// do something with your file
return YES;
}
return NO;
}
精彩评论