nativefileso icon indicating copy to clipboard operation
nativefileso copied to clipboard

Excellent work, can we avoid app restart on file open?

Open bhupiister opened this issue 4 years ago • 5 comments

Hi, first of all thanks for sharing your project. Excellent work done by you. I can open custom files with my app now. The only downside I feel is the app restart when opening a file from outside. I know it's the intended behaviour as per the limitations written by you. Can this be avoided anyhow?

bhupiister avatar Jan 01 '21 10:01 bhupiister

I at least didn't manage to find a way to make it work without it causing an entire app restart.

keiwando avatar Jan 10 '21 14:01 keiwando

@keiwando I later realised, it was more easy to handle file open when app restarts. Now I am missing this thing on IOS, is there some way to restart app on IOS as well?

bhupiister avatar Jan 10 '21 15:01 bhupiister

No, I don't think there is a way to force it to do that. Even if there was, it wouldn't be something that I would add to this plugin. Not having the entire app restart is the desired behaviour, so it's currently just the Android version that needs to be fixed.

keiwando avatar Jan 19 '21 16:01 keiwando

@keiwando I get it, but what if I am on some other scene and select the downloaded file from the notification window and open it. Is there some way to change the scene to the first one and proceed with the file open? Is there some way to do it in the plugin or I need to programme it?

bhupiister avatar Jan 21 '21 06:01 bhupiister

If you want to change the scene when a file is opened from outside of the app, you need to do it manually. Only you know whether and how to change between different scenes in you app (maybe you want to save some progress before going back to the first scene or maybe you don't want to go back at all etc.).

You can also always process the opened file in the current scene that you're in via the delegate callbacks.

keiwando avatar Jan 23 '21 10:01 keiwando