Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an exit event #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idpaterson
Copy link

This implementation is similar to cordova-plugin-inappbrowser with the notable exception that InAppBrowser instances are created for each call to open a URL and any events are scoped to that particular instance. You don't need to remove events because they are not triggered the next time the browser is opened. In contrast, SafariViewController is a singleton and therefore the events may continue to fire for subsequent browser instances if not cleaned up. A particularly bad but not unlikely implementation would be to add an exit listener every time the browser is opened and never remove the listeners.

Since there is only one event, currently it is easy to clean up the listener when it is called as shown in the demo. While the delegate does not allow nearly as much insight into the user's activity as in UIWebView, it is still possible that other events would be added (perhaps related to sharing) in which case a design closer to InAppBrowser may be an improvement.

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.

1 participant