Skip to content

Fix error when embed Flutter app to native iOS app (Add-to-app) - #10

Merged
javaherisaber merged 4 commits into
javaherisaber:masterfrom
nukeolay:master
Feb 4, 2024
Merged

Fix error when embed Flutter app to native iOS app (Add-to-app)#10
javaherisaber merged 4 commits into
javaherisaber:masterfrom
nukeolay:master

Conversation

@nukeolay

@nukeolay nukeolay commented Oct 9, 2023

Copy link
Copy Markdown

This pull request fixes an issue where calling OpenFilex.open() from a Flutter app embedded in a native iOS app would cause the future to never complete.

The investigation revealed that the rootViewController property on UIApplication.shared.delegate.window was nil in this case. To address this, the OpenFilePlugin.m file was modified to obtain the rootViewController without using this property.

This fix ensures that open_filex works correctly whether or not the Flutter app is embedded in a native iOS app. A comment has been added to the code to explain the change.

@yairsts

yairsts commented Dec 11, 2023

Copy link
Copy Markdown

Please merger it :)

@nukeolay nukeolay left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javaherisaber please merge it

@GustC

GustC commented Dec 15, 2023

Copy link
Copy Markdown

Thanks @nukeolay this resolve my problem 🙏

@kobe-paulo-reis

Copy link
Copy Markdown

@javaherisaber can you merge this pr, please?

@javaherisaber

Copy link
Copy Markdown
Owner

@nukeolay
Could you please create a sample project where you use that embedded view? I'm not that familiar with iOS Native

@nukeolay

nukeolay commented Jan 1, 2024

Copy link
Copy Markdown
Author

@nukeolay
Could you please create a sample project where you use that embedded view? I'm not that familiar with iOS Native

Sure. But where should I put this iOS native example?

@javaherisaber

Copy link
Copy Markdown
Owner

@nukeolay
You can create a repository in your own Github then share the link here

@nukeolay

nukeolay commented Jan 6, 2024

Copy link
Copy Markdown
Author

@nukeolay Could you please create a sample project where you use that embedded view? I'm not that familiar with iOS Native

You can get sample native iOS project at https://github.com/nukeolay/open_file_sample.git.
Instructions are in README.md

@javaherisaber

Copy link
Copy Markdown
Owner

@nukeolay
Thanks for the repo
I tried your sample project and it get's stuck after pressing Show flutter button
I also replace the flutter_open_file folder and referenced the changes that your made to another folder in that directory
But it didn't work either
Could you please explain what might go wrong here, am I missing a config or something?

@nukeolay

Copy link
Copy Markdown
Author

@nukeolay Thanks for the repo I tried your sample project and it get's stuck after pressing Show flutter button I also replace the flutter_open_file folder and referenced the changes that your made to another folder in that directory But it didn't work either Could you please explain what might go wrong here, am I missing a config or something?

Are you sure you're running example on a real device, not on an Simulator? It was mentioned in README

@nukeolay

nukeolay commented Feb 3, 2024

Copy link
Copy Markdown
Author

@javaherisaber can you confirm that you're running an example app on a real device?

@javaherisaber

Copy link
Copy Markdown
Owner

@nukeolay
I just tested your sample project on a real device and it works as expected
Will prepare a release on your changes

@nukeolay

nukeolay commented Feb 3, 2024

Copy link
Copy Markdown
Author

@nukeolay
I just tested your sample project on a real device and it works as expected
Will prepare a release on your changes

Thank you!

@javaherisaber
javaherisaber merged commit 9120b26 into javaherisaber:master Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants