MobileApplication.HandleURL not obvious

Thanks, Jason. No luck, I’m afraid. The crash still occurs with the same error.

The crash must be happening somewhere else I think. Can you post the complete crash log/stack trace? [NSString init] isnt called by any of the declares in iOSKit I believe. The error indicates no alloc call is happening which I dont see how that is possible.

Sorry to nag on this topic. Has anybody got opening a file from handleURL working yet?
very frustrating.

Back on Feb 9th you said the example I gave you was working… what changed?

I started using 2021r1, which was in development at that time.

I believe that it started happening with use of the filetypes which wasn’t previously available for iOS.
Of course none of this suggests I may not be messing it up dramatically myself.

So… I just tried this with the example I provided, updated it for 2021 and it still seems to work:

https://www.dropbox.com/s/haevm2wvndpho7g/URLTester2021.zip?dl=1

… in the simulator. It is not working on my phone. sorry about that.

Did you try to run it from your actual iPhone?
The example you provided works fine in the simulator, but nothing happens when I try to open the file from my iPhone.
It does bring the app to the foreground, but it doesn’t read the file.

oops, our messages crossed. Sorry.
Yes, this is the problem I’ve been having too.

And further, in my project I’ve added a pile-o message boxes to the handleURL event to try to debug. I see them all.
In yours none of those even fire.
I cannot believe that nobody else has seen this by now, or that nobody else has found a way around it.
I’ve tried all the usual things: jiggling the handle, flushing twice, swearing at it, making passive aggressive threats to my laptop… nothing works.

Strange. This usually works quite well for me.

1 Like

SUCCESS

I finally came back to this and solved it. However it seems to be an indication of a different Xojo bug.
I had been trying to copy the file to SpecialFolder.Temporary.child(xyz). I have another thread on this but I cannot mange to write to that directory or others that are available from SpecialFolder (except documents). I did make sure that the directory exists.

Now I make a cache folder in my documents, write it to there, and everything works fine.

And IsWritable returns True?

I’ll write a small test and verify everything.

Greg, I need to dig into this a bit more. It does seem that ApplicationSupport doesn’t exist and have to create it.
I did similar with the temporary folder, but was still having problems writing to it. It’s very confusing because I do get different behavior between simulator and real hardware. However using the Documents folder is working in 100% of the cases.

It could simply be that the ApplicationSupport and Temporary folders existed when we made the first version of Xojo iOS but that they don’t any more and that creating them is no longer allowed.

Hi Chris,
Do you have a working example I am still stuck back at Greg’s example and can’t get it to work in the sim or physical.
Thanks

Greg’s example ended up working for me.
For me it was down to not assuming paths existed.

1 Like