title: Sending custom file types via AirDrop
body: <p>I am building an Objective-C app that uses the AirDrop function included in iOS. The file I am trying to send is a .plist file, technically considered a custom file type for some reason. When receiving a .plist file from my Mac, all goes perfectly fine, but when I try to send, the AirDrop fails immediately, and I was able to get an error to be displayed in the debugger.</p>
  
  <p>It says:</p>
  
  <pre><code>AirDrop: Invalid URL (no scheme) /var/mobile/Containers/Data/Application/AB771F7E-AFDB-4CB4-8D60-E1B62BAB8A62/Documents/Chicken.plist
  </code></pre>
  
  <p>And later:</p>
  
  <pre><code>Sender kSFOperationEventErrorOccured { Error = "Error Domain=SFOperation Code=-4 \"The transfer failed because there were no valid files to send.\" 
  </code></pre>
  
  <p>Finally, the error's NSLocalizedDescription says :</p>
  
  <pre><code>UserInfo={NSLocalizedDescription=The transfer failed because there were no valid files to send.}
  </code></pre>
  
  <p>I'm not sure why it does not find the file, as I use similar code throughout the app to retrieve files from that directory, and it all works fine. Here is the code in the IBAction method that is called when the user presses the share button:</p>
  
  <pre><code>recipeName = [[NSUserDefaults standardUserDefaults]
                          stringForKey:@"recipeName"];
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *appFolderPath = [paths objectAtIndex:0];
  NSString *plistName = [recipeName stringByAppendingString:@".plist"]; //add ".plist" to the end of the recipe name
  NSString *fileName = [appFolderPath stringByAppendingPathComponent:plistName]; //find plist
  
  
  NSURL *url = [NSURL URLWithString:fileName];
  UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[url] applicationActivities:nil];
  
  // Exclude all activities except AirDrop.
  NSArray *excludedActivities = @[UIActivityTypePostToTwitter, UIActivityTypePostToFacebook,
                                  UIActivityTypePostToWeibo,
                                  UIActivityTypeMessage, UIActivityTypeMail,
                                  UIActivityTypePrint, UIActivityTypeCopyToPasteboard,
                                  UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll,
                                  UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr,
                                  UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo];
  controller.excludedActivityTypes = excludedActivities;
  
  // Present the controller
  [self presentViewController:controller animated:YES completion:nil];
  </code></pre>
  
  <p>Thanks in advance</p>