GithubHelp home page GithubHelp logo

droptestarticle's Introduction

Apple Mail Drag and Drop Issue Sample

This repository contains a sample Xcode project demonstrating an issues with receiving email message files (*.eml) from Apple Mail using a NSFilePromiseReceiver.

There is an example of a workaround to this issue in the workaround branch that uses file system events to catch the eMail being dropped onto the app.

The code in this repo is purposely written in a way that closely follows Apple's own sample code so that any possible implementation errors on my end are kept to an absolute minimum.

What is this project supposed to do?

The app in this project displays a view (DropView & DropViewController) that is configured to accept .eml email files via drag and drop file promises.

When an appropriate file is dropped onto said view, the app should resolve the file promise(s) by having them written to a temporary directory. Once that's done, a simple message should be print()-ed to the console, displaying the temporary location the promised file has been written to.

What seems to be the issue?

When receiving drag and drop file promises from Apple's Mail.app, this does not seem to work as expected.

The file promise is resolved and the files are written to the requested temporary location, however, when resolving the promise the application hangs for fairly exactly 60 seconds and then passes an error to the callback block of NSFilePromiseReceiver.receivePromisedFiles that reads as follows:

Error Domain=NSURLErrorDomain Code=-1001 "(null)"

How have I tried to troubleshoot it so far

I've attempted to use other apps that can use file promises to drag and drop email messages (e.g. Microsoft Outlook) with the code in this project and those attempts seem to work without issue. I'm only able to reproduce this issue with Apple Mail (running macOS Catalina, though I have not yet been able to test other versions of macOS).

It appears as though some code that's generating the NSURL for the NSFilePromiseReceiver.receivePromisedFiles callback block is timing out, though I'm not yet sure why.

I have verified that the requested files are always placed in the desired location by the file promise providing app, even Apple Mail. It's just that with Apple Mail, the aforementioned NSURL error makes using the files once placed in the requested location impossible because of the 60 second delay & the error, leaving the passed URL empty.

droptestarticle's People

Contributors

skyeewers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.