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

[Android & iOS] Support of window.print() function #3318

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

birdofpreyru
Copy link

@birdofpreyru birdofpreyru changed the title [Android] Support of window.print() function [Android & iOS] Support of window.print() function Feb 6, 2024
@scamp81
Copy link

scamp81 commented Feb 8, 2024

Would love to see this applied. We've been fighting this printing issue on ios for a while.

@birdofpreyru
Copy link
Author

birdofpreyru commented Feb 8, 2024

@scamp81 Unfortunately, I can't say yet it completely works on iOS — I still haven't figured out how, and whether it is possible to print there the entire page, rather than just the visible WebView viewport. On macOS I kind of found a way to make it work, but that goes against Apple docs on how snapshot config is supposed to work, and it does not work the same on iOS, so... perhaps I overlooked something and I neither have a good solution for macOS.

As usual, it just works on Android — iOS software & APIs suck!!! 🤣

# Conflicts:
#	apple/RNCWebViewImpl.m
@birdofpreyru
Copy link
Author

Update: Now it feels I have figured out the right way to do the printing on iOS. Turns out to be quite straightforward, but not easy to figure out starting from WKWebView documentation, neither I saw that right solution in StackOverflow answers to the writing questions :( The PR is updated accordingly.

@frontendguru1
Copy link

Hi @birdofpreyru
I am encountering the same issue in one of my projects where I need to open the print preview, allowing the user to print or download the file as a PDF.

As far as I can see, this PR is still pending merging.

@frontendguru1
Copy link

Hi @jamonholmgren @Titozzz
Could you please approve and merge PR?

@birdofpreyru
Copy link
Author

@frontendguru1 , you might want to consider switching to my fork of react-native-webview — I got tired of waiting while this, and a few other PRs of mine with critical fixes, gets merged-in (the first of them is pending since Jan 16, 2024), and after depending on a locally built, patched version of react-native-webview in my projects, I decided it is a high time to publish my fork to NPM.

@frontendguru1
Copy link

frontendguru1 commented Feb 19, 2024 via email

@birdofpreyru
Copy link
Author

Have you published this to NPM?

Yeap.

@frontendguru1
Copy link

frontendguru1 commented Feb 19, 2024 via email

@birdofpreyru
Copy link
Author

@frontendguru1
Copy link

frontendguru1 commented Feb 19, 2024 via email

@sgtpsibin
Copy link

@Titozzz could you please review this PR?

@yashwanthsandeep
Copy link

yashwanthsandeep commented Mar 18, 2024

@birdofpreyru
Thanks for the fix, its working in both android and iOS.
Please help review the PR, thank you

Copy link

Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label May 18, 2024
@birdofpreyru
Copy link
Author

Right, bot, three months later maintainers still haven’t found time to merge in my PR; in the meantime I’ve already started my fork of this library — a few steps ahead of the upstream, and could be even better, if anybody backed me up financially.

@github-actions github-actions bot removed the Stale label May 19, 2024
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

5 participants