Fix error when embed Flutter app to native iOS app (Add-to-app) - #10
Conversation
|
Please merger it :) |
|
Thanks @nukeolay this resolve my problem 🙏 |
|
@javaherisaber can you merge this pr, please? |
|
@nukeolay |
Sure. But where should I put this iOS native example? |
|
@nukeolay |
You can get sample native iOS project at https://github.com/nukeolay/open_file_sample.git. |
|
@nukeolay |
Are you sure you're running example on a real device, not on an Simulator? It was mentioned in README |
|
@javaherisaber can you confirm that you're running an example app on a real device? |
|
@nukeolay |
Thank you! |
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.