Open gjae opened 1 year ago
👋 @gjae
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE]
or ios WKWebView [MY ERROR HERE]
keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
Yes,
I'm also facing the same issue.
In Android, I'm able to open and capture images using front and back cameras but in IOS I'm not able to open the front camera.
can anyone help me with it,
Here is my code.
InAppWebView( initialUrlRequest: URLRequest(url: WebUri(widget.webUrl.toString())), initialSettings: InAppWebViewSettings( allowFileAccess: true, allowContentAccess: true, iframeAllow: "camera; microphone", iframeAllowFullscreen: true, mediaPlaybackRequiresUserGesture: false, useShouldOverrideUrlLoading: true, useHybridComposition:true, allowsInlineMediaPlayback: true, javaScriptEnabled: true, hardwareAcceleration: true), shouldOverrideUrlLoading: (controller, navAction) async { return NavigationActionPolicy.ALLOW; }, onReceivedError: (controller, request, error){ AppLog.logPrint("RECEIVED ERROR: ${error}"); }, onPermissionRequest: (controller, request) async { print(request); return PermissionResponse( resources: request.resources, action: PermissionResponseAction.GRANT); }, onWebViewCreated: (InAppWebViewController inAppWebViewController) { _controller.complete(inAppWebViewController); }, onLoadStart: (InAppWebViewController, url) { setState(() { this.url = url?.toString() ?? ''; }); }, onReceivedServerTrustAuthRequest: (_, challenge) async { return ServerTrustAuthResponse(action: ServerTrustAuthResponseAction.PROCEED); }, onCameraCaptureStateChanged: (inAppWebViewController, oldState, newState) async { var state= await inAppWebViewController.getCameraCaptureState(); return inAppWebViewController.setCameraCaptureState( state:state!); }, onConsoleMessage: (InAppWebViewController, consoleMessage) { AppLog.logPrint(consoleMessage); /*if (controller.status.isSuccess == 1) { Get.offAll(const BottomNav(setIndex: 0)); }*/ // it will print: {message: {"bar":"bar_value","baz":"baz_value"}, messageLevel: 1} }, onPageCommitVisible: (InAppWebViewController, url) async { InAppWebViewController.canGoBack(); }, onProgressChanged: (InAppWebViewController, progress) { setState(() { this.progress = progress / 100; }); }, shouldInterceptAjaxRequest: (InAppWebViewController controller, AjaxRequest ajaxRequest) async { print(ajaxRequest.url); return ajaxRequest; }, onAjaxReadyStateChange: (InAppWebViewController _controller, AjaxRequest ajaxRequest) async { AppLog.logPrint(ajaxRequest.status); return AjaxRequestAction.PROCEED; }, onAjaxProgress: (InAppWebViewController _controller, AjaxRequest ajaxRequest) async { AppLog.logPrint(ajaxRequest.status); return AjaxRequestAction.PROCEED; }, onLoadStop: (InAppWebViewController, url) async { if (url.toString() == ApiConst.kycSuccessUrlDev) { await PreferenceUtils.setString( AppConstants.KYC_STATUS, KycStatus.kycSuccessful); //Get.offAll(const BottomNav(setIndex: 0)); Get.to(const KYCSuccessScreen()); //ApiRepo.showToast("KYC Completed Successfully", isForError: false); } //InAppWebViewController.canGoBack(); }, androidOnPermissionRequest: (InAppWebViewController controller, String origin, List<String> resources) async { return PermissionRequestResponse( resources: resources, action: PermissionRequestResponseAction.GRANT); }),
I'm working with face recognition, therefore I need open selfie camera, in Android works fine but Ios open back camera instead of selfie camera. How can I open selfie camera as default?.
My Js code: