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

Disabling text selection / Copying / sharing [IOS] #80

Open
KhaledAbdElNasserAhmed opened this issue May 7, 2023 · 10 comments
Open

Disabling text selection / Copying / sharing [IOS] #80

KhaledAbdElNasserAhmed opened this issue May 7, 2023 · 10 comments

Comments

@KhaledAbdElNasserAhmed
Copy link

Is there any way to disable text copying in IOS, can you provide any hints or methods to use to that.

@jmgeffroy
Copy link
Contributor

jmgeffroy commented May 10, 2023

Hello @KhaledAbdElNasserAhmed, we currently do not provide this. Can you please explain under which conditions text selection would be disabled? Would it be based on some metadata inside the Epub, or globally in the whole app?

@KhaledAbdElNasserAhmed
Copy link
Author

KhaledAbdElNasserAhmed commented May 17, 2023

Globally in the whole ereader, I am currently using your library in one of my book publishing apps, the user can select text from the whole book and paste it anywhere, which is not helpful when publishing paid books, so I was able to disable copying and screen shooting in Android in the whole epub reader but failed to do the same in IOS, any insights on how to disable text sharing / selection and copying would be wonderful.

I think it has something to do with the kwebviewer that is used in IOS.

@jmgeffroy
Copy link
Contributor

@KhaledAbdElNasserAhmed Thank you for the explanation. Understood. You need a global setting. I'll provide it through the API.

@westernbuptboy
Copy link

Globally in the whole ereader, I am currently using your library in one of my book publishing apps, the user can select text from the whole book and paste it anywhere, which is not helpful when publishing paid books, so I was able to disable copying and screen shooting in Android in the whole epub reader but failed to do the same in IOS, any insights on how to disable text sharing / selection and copying would be wonderful.

I think it has something to do with the kwebviewer that is used in IOS.

Dear Developer

I found that selecting text for this project on iOS does not trigger a pop event in the code, but it is normal on Android. I see you raised this question. Do you understand how to make selected events on iOS also be captured? Thank you!。

@winterdl
Copy link

@KhaledAbdElNasserAhmed if you upgrade to InAppWebView 6.x and ios 13.0+, you could use this property to disable text selection: isTextInteractionEnabled: false

@jmgeffroy
Copy link
Contributor

jmgeffroy commented Aug 11, 2023

@winterdl Thanks for the tip. I had yet to see this beta. If I read the Apple documentation and InAppWebView source code correctly, it is available in iOS 14.5 (iOS 15 in InAppWebView's source code).
I'd happily integrate this setting, but setting the minimum iOS to 15 is pretty radical.
Any thoughts, @westernbuptboy @winterdl @KhaledAbdElNasserAhmed?

@jmgeffroy
Copy link
Contributor

No big danger according to this article. I should probably move forward....

@jmgeffroy
Copy link
Contributor

I implemented and tested it, it works as expected. I haven't found a similar option for Android. Id' like to avoid injecting JS to do this. Any hint? For now I'm not doing the PR, I'll wait until I have a clean solution for Android.

@westernbuptboy
Copy link

@KhaledAbdElNasserAhmed if you upgrade to InAppWebView 6.x and ios 13.0+, you could use this property to disable text selection: isTextInteractionEnabled: false

Selecting text on iOS cannot pop up a custom window, only the default window pops up. Is there a way to solve this?

@westernbuptboy
Copy link

westernbuptboy commented Aug 11, 2023

maybe i find the solution update the flutter_inappwebview plugin pichillilorenzo/flutter_inappwebview#1575

jmgeffroy added a commit to jmgeffroy/iridium that referenced this issue Aug 11, 2023
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

No branches or pull requests

4 participants