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 support for alert and confirm #76

Merged
merged 16 commits into from
Dec 13, 2023
Merged

Conversation

mironiasty
Copy link
Member

@mironiasty mironiasty commented Dec 11, 2023

Add new props to VisitableView to support web alert and confirm dialogs.

There is also default support for both (that was missing before). So both alert and confirm will now work as React Native's Alert.alert call.

@mironiasty mironiasty marked this pull request as ready for review December 12, 2023 18:03
@mironiasty mironiasty requested review from pfeiffer, sebryu and pklatka and removed request for pfeiffer December 12, 2023 18:03
packages/turbo/src/hooks/useWebViewDialogs.ts Outdated Show resolved Hide resolved
packages/turbo/src/hooks/useWebViewDialogs.ts Outdated Show resolved Hide resolved
let session = Session(webViewConfiguration: webViewConfiguration)
session.delegate = self
session.webView.allowsLinkPreview = false
session.webView.uiDelegate = self.wkUiDelegate
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe let's remove wkUiDelegate variable and set TurboUIDelegate(uiHandler: self) here? We don't use self.wkUiDelegate anywhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it because uiDelegate is weak property. Is there better way of making it correct in swift? 🤔

Copy link
Collaborator

@pklatka pklatka Dec 13, 2023

Choose a reason for hiding this comment

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

I did it because uiDelegate is weak property.

You're right, let's leave it as it is.

packages/turbo/ios/RNSession.swift Outdated Show resolved Hide resolved
packages/turbo/ios/RNSession.swift Outdated Show resolved Hide resolved
packages/turbo/ios/RNSession.swift Outdated Show resolved Hide resolved
packages/turbo/ios/RNSession.swift Outdated Show resolved Hide resolved
@mironiasty mironiasty merged commit 678c96a into main Dec 13, 2023
1 check passed
@pklatka pklatka deleted the add-support-for-alert-ios branch March 19, 2024 13:31
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.

None yet

3 participants