From 3d5bce903d48c2706dc3c49dd16a8668998dbf86 Mon Sep 17 00:00:00 2001 From: Godwin Asuquo Date: Mon, 16 Jan 2023 17:46:04 +0100 Subject: [PATCH] Fix android permission request --- lib/src/screens/buy/onramper_page.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/screens/buy/onramper_page.dart b/lib/src/screens/buy/onramper_page.dart index eb0370a67..2f7ab60cf 100644 --- a/lib/src/screens/buy/onramper_page.dart +++ b/lib/src/screens/buy/onramper_page.dart @@ -5,6 +5,7 @@ import 'package:cw_core/wallet_base.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/.secrets.g.dart' as secrets; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; +import 'package:permission_handler/permission_handler.dart'; class OnRamperPage extends BasePage { OnRamperPage({ @@ -81,6 +82,11 @@ class OnRamperPageBodyState extends State { ), ), androidOnPermissionRequest: (_, __, resources) async { + + if (await Permission.camera.status != PermissionStatus.granted){ + await Permission.camera.request(); + } + return PermissionRequestResponse( resources: resources, action: PermissionRequestResponseAction.GRANT,