pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.17k stars 1.54k forks source link

Crash on real iOS device #177

Open thunshell opened 4 years ago

thunshell commented 4 years ago

It work when press IconButton on iOS simulator, but crash on real iOS device.

device: iPhone 6, version: 12.4.1

environment: sdk: ">=2.1.0 <3.0.0" flutter_inappbrowser: ^1.2.1

Code bellow: ` void main(List args) { runApp(MyApp()); }

class MyApp extends StatelessWidget { const MyApp({Key key}) : super(key: key);

@override Widget build(BuildContext context) { return MaterialApp( title: 'flutter app', debugShowCheckedModeBanner: false, home: TestPage(), ); } }

class TestPage extends StatefulWidget { final String url; const TestPage({Key key, this.url}):super(key: key); @override _TestPageState createState() => _TestPageState(); }

class _TestPageState extends State {

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Flutter App'), actions: [ IconButton(icon: Icon(Icons.scanner), onPressed: ()=> Navigator.of(context).push(new MaterialPageRoute(builder: (context) => TestPage(url: 'about:blank',))),) ], ), body: InAppWebView( initialUrl: widget.url ?? 'https://flutter.dev', initialOptions: { 'useShouldOverrideUrlLoading': true, }, shouldOverrideUrlLoading: (c, u){ Navigator.of(context).push(new MaterialPageRoute(builder: (context) => TestPage(url: u,))); }, ), ); } }`

pichillilorenzo commented 4 years ago

Try the latest version of the plugin. Also, this plugin changed its name to flutter_inappwebview. The current latest version now is 2.1.0+1. So, you can change your dependency influtter_inappwebview: ^2.1.0+1. However, can you post here the logs you get from Xcode, please?