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

Add cross-origin redirect delegate #203

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pfeiffer
Copy link
Contributor

Follow-up of #201.

As discussed in #201 it would be preferrable to handle cross-origin redirects in the SessionDelegate.

This PR takes a stab at that to get the ball rolling so we can get feature parity between iOS and Android libs again :-)

@joemasilotti joemasilotti changed the base branch from cross-origin-redirect to main May 2, 2024 16:12
Copy link
Member

@joemasilotti joemasilotti left a comment

Choose a reason for hiding this comment

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

I like this approach much better! I tested running against the demo PR and everything works as expected after adding the require delegate callback.

I added one suggestion to make the documentation even more obvious where the cross-origin redirect handling code should go.

Comment on lines +112 to +113
navigationController.popViewController(animated: false)
UIApplication.shared.open(url)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
navigationController.popViewController(animated: false)
UIApplication.shared.open(url)
func session(_ session: Session, didProposeVisitToCrossOriginRedirect url: URL) {
navigationController.popViewController(animated: false)
UIApplication.shared.open(url)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants