EddyVerbruggen / cordova-plugin-safariviewcontroller

:tiger: :elephant: :crocodile: Forget InAppBrowser for iOS - this is way better for displaying read-only web content in your PhoneGap app
MIT License
282 stars 144 forks source link

The hide API on iOS closes last child viewcontroller, should instead use the reference to its own child VC. #142

Open sachingarg05 opened 5 years ago

sachingarg05 commented 5 years ago

On iOS, hide API looks for last child viewcontroller and removes it. If some other child viewcontroller was added (by some other plugin) after this plugin's show, then hide mistakenly closes that viewcontroller instead.

Same issue if hide is called without calling this plugin's show first, and some other child viewcontroller was added by another plugin.

Hide API should instead keep a reference to its viewcontroller object and use that to close. Plugin already keeps SFSafariViewController *vc; which looks like what hide can use.