I am experimenting with Airdrop on my iPhone 6 (iOS 9.2), running my app. I have set up the info.plist with the Document Types according to the Apple UTI types documentation. With my app running, if I try to send a one-line .txt file to the app via Airdrop, the phone crashes and resets. I have a breakpoint set in my app delegate.m in the method that should be called when a URL is received via Airdrop, but the breakpoint is not executed. Here is the relevant app delegate.m code. This is the method in the code where I set the breakpoint (at the NSLog).
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSLog(@"url: %@", url);
NSURL *urlToOpen = url;
NSString *contentOfFile = [NSString stringWithContentsOfURL:urlToOpen encoding:NSUTF8StringEncoding error:nil];
NRCTableViewController *controller = [[NRCTableViewController alloc]init];
controller.urlText = contentOfFile;
[controller receiveURL];
return YES;
}
There is nothing in the device crash log. I have searched here and elsewhere (Google) but have not found anything about this.
Here is a screen shot of the info.plist showing the Document Types.
I have successfully sent the same one-line text file to a short Airdrop demo app with the same Document Types.
I would appreciate any help. Thanks!