Support Add to Existing App use case
The current implementation assumes the plugin is used in a pure Flutter app. It casts the app's rootViewController to FlutterViewController.
This supports using this plugin in an "add to app" use case. The implementation does not assume the rootViewController is an instance of FlutterViewController, but rather starts with the presented view controller, and navigates up the stack to the root controller. It also handles in the case of a non-modal screen, in which case it would be a UINavigationController. We could probably just use the presented view controller, rather than navigating up the stack to the root to use as the session context provider.
Sorry for the slow review on this one π
Would you be able to tell me how to test this out? Would be perfect if you have an example project that demonstrates the problem βΊοΈ
Sorry for the slow review on this one π
Would you be able to tell me how to test this out? Would be perfect if you have an example project that demonstrates the problem βΊοΈ
I don't have a readily available public project for you to test. You need to create a Flutter module that uses the plugin, then create a natives iOS project to embed the Flutter module. If you have a project you use to test this plugin you can turn it into a module and embed in a Xcode project. The instruction is here: https://flutter.dev/docs/development/add-to-app/ios/project-setup. I have my version running in 2 commercial projects.
Just some small changes, otherwise looks great π
I understand if you don't have the motivation to work on this since I've been so slow to respond, sorry about that! I'll try to apply the suggested changes myself and merge this if you don't feel like it βΊοΈ
Just some small changes, otherwise looks great π
I understand if you don't have the motivation to work on this since I've been so slow to respond, sorry about that! I'll try to apply the suggested changes myself and merge this if you don't feel like it βΊοΈ
Thanks for reviewing. I agree with the changes. I actually had to change my computer so don't have this repo readily available. If you get to it before I do please go ahead and change and merge! Appreciate it.
A version of this was merged in https://github.com/LinusU/flutter_web_auth/pull/106 π