[WIP][iOS]Add TextField OCR engine side support#29229
[WIP][iOS]Add TextField OCR engine side support#29229luckysmg wants to merge 21 commits intoflutter:mainfrom
Conversation
|
The new API |
This is dependent on flutter/flutter#85555 |
b1a8771 to
2962099
Compare
|
I want to use |
…InputPlugin test.
|
Hi @chunhtai Could you give this PR a review? Thx😄 |
jmagman
left a comment
There was a problem hiding this comment.
This LGTM, @LongCatIsLooong would you mind also taking a look?
|
|
||
| - (BOOL)captureTextFromCameraEnabled { | ||
| UITextField* textField = [self textField]; | ||
| return [textField canPerformAction:@selector(captureTextFromCamera:) withSender:nil]; |
There was a problem hiding this comment.
Is there a notification you can listen to, if the value you get here changes?
There was a problem hiding this comment.
For instance will the value become false, if the user rejects the camera permission?
There was a problem hiding this comment.
This api invokes system internal camera API and it seems that is will not ask users for camera permission..
There was a problem hiding this comment.
iOSDemo 2.zip
Here is demo code. I didn't request any permission
There was a problem hiding this comment.
Without the capability of monitoring the results of this canPerformAction: call I think it would be better to implement this feature in a way that's similar to paste: introduce an API that allows the developer to query whether live text is currently enabled on the platform, otherwise they may get outdated value?
There was a problem hiding this comment.
Got it. I will take a look. Thx
There was a problem hiding this comment.
Ah I thought you could still turn camera access off in Settings? (don't have a test device available atm, I'll give this a try tomorrow)
There was a problem hiding this comment.
Yeah if you disable camera access in Settings -> Screen Time -> Content & Privacy Restrictions -> Allowed Apps, the text edit menu item will be gone.
|
Oh,I didn't find this place before😯😯.
Got it. I will find a better solution,Thx😁😁
发自我的iPhone
…------------------ Original ------------------
From: LongCatIsLooong ***@***.***>
Date: Thu,Jun 2,2022 0:59 AM
To: flutter/engine ***@***.***>
Cc: WenJingRui ***@***.***>, Author ***@***.***>
Subject: Re: [flutter/engine] [iOS]Add TextField OCR engine side support (PR #29229)
@LongCatIsLooong commented on this pull request.
In shell/platform/darwin/ios/framework/Source/FlutterViewController.mm:
> @@ -1621,6 +1634,11 @@ - (NSString*)contrastMode { } } +- (BOOL)captureTextFromCameraEnabled { + UITextField* textField = [self textField]; + return [textField ***@***.***(captureTextFromCamera:) withSender:nil];
Yeah if you disable camera access in Settings -> Screen Time -> Content & Privacy Restrictions -> Allowed Apps, the text edit menu item will be gone.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Hi @jmagman @LongCatIsLooong |
Preview:
https://user-images.githubusercontent.com/49340347/137671033-cf99050f-e4f3-47eb-a346-1b7e4063a2b8.mp4
Related PR in flutter framework (WIP)
flutter/flutter#96637
List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#91896
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.