update webview permission implementation

This commit is contained in:
Godwin Asuquo 2023-01-10 18:14:26 +01:00
parent 3dbf5d8b8c
commit 6434f36f1a
2 changed files with 9 additions and 9 deletions

View file

@ -11,7 +11,6 @@ import 'package:flutter/services.dart';
import 'package:hive/hive.dart';
import 'package:cake_wallet/di.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
@ -45,7 +44,6 @@ final rootKey = GlobalKey<RootState>();
Future<void> main() async {
try {
WidgetsFlutterBinding.ensureInitialized();
await Permission.camera.request();
final appDir = await getApplicationDocumentsDirectory();
await Hive.close();
Hive.init(appDir.path);

View file

@ -1,4 +1,3 @@
import 'dart:io';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/store/settings_store.dart';
@ -76,9 +75,12 @@ class OnRamperPageBodyState extends State<OnRamperPageBody> {
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(transparentBackground: true),
),
initialUrlRequest: URLRequest(url: Uri.tryParse(widget.uri.toString(),
),
)
androidOnPermissionRequest: (_, __, resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT,
);
},
);
}
}