Question

I have an app that recognizes an extension of a file created in my app on iOS.

When I email myself a file I created and use "Open In" from Mail, or if I "Open In" from Dropbox app everything works as planned. Where things breakdown is if I go to the Dropbox webpage of the file in Mobile Safari. Here the grey screen loads with the "Open In" option, and it loads my app when I tap the button, and I even get a URL in my app to work with, but ultimately my app fails at loading the data sent from Mobile Safari. I believe this is because the data is altered by Mobile Safari, because byte length of the NSData from Mail or the Dropbox app is 916,406, while from Mobile Safari it is 925,519.

Does anyone know what Mobile Safari does to data when sending it to other iOS apps that is different from what the Mail or Dropbox app?

Was it helpful?

Solution

I figured out what was going on. The data I'm downloading into my app is compressed using gzip. It turns out that when Mobile Safari sends the file to my app, it sends the uncompressed file, whereas if I open the file from Mail or the Dropbox app, it sends the compressed file.

So now I just check if data is coming from Mobile Safari, and if it is, I don't decompress it. Hope this helps someone else out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top