Commit 463b95c3 authored by Lorenzo Pichilli's avatar Lorenzo Pichilli

updated README.md

parent e1e1574d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
- Added Android keyboard workaround to hide the keyboard when clicking other HTML elements, losing the focus on the previous input - Added Android keyboard workaround to hide the keyboard when clicking other HTML elements, losing the focus on the previous input
- Added `onEnterFullscreen`, `onExitFullscreen` webview events - Added `onEnterFullscreen`, `onExitFullscreen` webview events
- Fixed `Print preview is not working? java.lang.IllegalStateException: Can print only from an activity` [#128](https://github.com/pichillilorenzo/flutter_inappwebview/issues/128) - Fixed `Print preview is not working? java.lang.IllegalStateException: Can print only from an activity` [#128](https://github.com/pichillilorenzo/flutter_inappwebview/issues/128)
- Fixed `onJsAlert`, `onJsConfirm`, `onJsPrompt` for `InAppBrowser` on Android
## 3.2.0 ## 3.2.0
......
...@@ -24,6 +24,18 @@ During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot ...@@ -24,6 +24,18 @@ During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot
Also, you need to add `<uses-permission android:name="android.permission.INTERNET"/>` in the `android/app/src/main/AndroidManifest.xml` file in order to give minimum permission to perform network operations in your application. Also, you need to add `<uses-permission android:name="android.permission.INTERNET"/>` in the `android/app/src/main/AndroidManifest.xml` file in order to give minimum permission to perform network operations in your application.
If you `flutter create`d your project prior to version `1.12`, you need to make sure to update your project in order to use the new **Java Embedding API**!
Take a look at the official Flutter wiki: [Upgrading pre 1.12 Android projects](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects).
Also, you can refer to the [#343](https://github.com/pichillilorenzo/flutter_inappwebview/issues/343) issue.
Remember to add `<meta-data>` tag inside the `<application>` tag of your `android/app/src/main/AndroidManifest.xml`:
```xml
<meta-data
android:name="flutterEmbedding"
android:value="2" />
```
as mentioned in the 6th step of [Full-Flutter app migration](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects#full-flutter-app-migration) guide.
**Without this, the plugin will NOT work!!!**
Because of [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0`. Because of [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0`.
Also, note that to use the `InAppWebView` widget on Android, it requires **Android API 20+** (see [AndroidView](https://api.flutter.dev/flutter/widgets/AndroidView-class.html)). Also, note that to use the `InAppWebView` widget on Android, it requires **Android API 20+** (see [AndroidView](https://api.flutter.dev/flutter/widgets/AndroidView-class.html)).
...@@ -55,6 +67,40 @@ end ...@@ -55,6 +67,40 @@ end
Instead, if you have already a non-swift project, you can check this issue to solve the problem: [Friction adding swift plugin to objective-c project](https://github.com/flutter/flutter/issues/16049). Instead, if you have already a non-swift project, you can check this issue to solve the problem: [Friction adding swift plugin to objective-c project](https://github.com/flutter/flutter/issues/16049).
**Support HTTP request**: you need to disable Apple Transport Security (ATS) feature. There're two options:
1. Disable ATS for a specific domain only: (add following codes to your `Info.plist` file)
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.yourserver.com</key>
<dict>
<!-- add this key to enable subdomains such as sub.yourserver.com -->
<key>NSIncludesSubdomains</key>
<true/>
<!-- add this key to allow standard HTTP requests, thus negating the ATS -->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!-- add this key to specify the minimum TLS version to accept -->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
```
2. Completely disable ATS: (add following codes to your `Info.plist` file)
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
```
Other useful `Info.plist` properties are:
* `NSAllowsLocalNetworking`: A Boolean value indicating whether to allow loading of local resources ([Official wiki](https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity/nsallowslocalnetworking);
* `NSAllowsArbitraryLoadsInWebContent`: A Boolean value indicating whether all App Transport Security restrictions are disabled for requests made from web views ([Official wiki](https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity/nsallowsarbitraryloadsinwebcontent).
## Getting Started ## Getting Started
For help getting started with Flutter, view our online For help getting started with Flutter, view our online
......
...@@ -54,8 +54,6 @@ public class FlutterWebView implements PlatformView, MethodCallHandler { ...@@ -54,8 +54,6 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
InAppWebViewOptions options = new InAppWebViewOptions(); InAppWebViewOptions options = new InAppWebViewOptions();
options.parse(initialOptions); options.parse(initialOptions);
Log.d(LOG_TAG, "\n\n\n Shared.activity " + ((Shared.activity == null) ? "is null" : "is NOT null!") + "\n\n\n");
webView = new InAppWebView(Shared.activity, this, id, options, contextMenu, containerView); webView = new InAppWebView(Shared.activity, this, id, options, contextMenu, containerView);
displayListenerProxy.onPostWebViewInitialization(displayManager); displayListenerProxy.onPostWebViewInitialization(displayManager);
......
...@@ -1496,12 +1496,6 @@ final public class InAppWebView extends InputAwareWebView { ...@@ -1496,12 +1496,6 @@ final public class InAppWebView extends InputAwareWebView {
sendOnCreateContextMenuEvent(); sendOnCreateContextMenuEvent();
} }
@Override
public boolean onCheckIsTextEditor() {
Log.d(LOG_TAG, "onCheckIsTextEditor");
return super.onCheckIsTextEditor();
}
private void sendOnCreateContextMenuEvent() { private void sendOnCreateContextMenuEvent() {
HitTestResult hitTestResult = getHitTestResult(); HitTestResult hitTestResult = getHitTestResult();
Map<String, Object> hitTestResultMap = new HashMap<>(); Map<String, Object> hitTestResultMap = new HashMap<>();
......
package com.pichillilorenzo.flutter_inappwebview.InAppWebView; package com.pichillilorenzo.flutter_inappwebview.InAppWebView;
import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.ConsoleMessage; import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions; import android.webkit.GeolocationPermissions;
import android.webkit.JsPromptResult; import android.webkit.JsPromptResult;
...@@ -76,16 +84,18 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -76,16 +84,18 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
if (mCustomView == null) { if (mCustomView == null) {
return null; return null;
} }
return BitmapFactory.decodeResource(Shared.activity.getApplicationContext().getResources(), 2130837573); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
return BitmapFactory.decodeResource(activity.getApplicationContext().getResources(), 2130837573);
} }
@Override @Override
public void onHideCustomView() { public void onHideCustomView() {
View decorView = Shared.activity.getWindow().getDecorView(); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
View decorView = activity.getWindow().getDecorView();
((FrameLayout) decorView).removeView(this.mCustomView); ((FrameLayout) decorView).removeView(this.mCustomView);
this.mCustomView = null; this.mCustomView = null;
decorView.setSystemUiVisibility(this.mOriginalSystemUiVisibility); decorView.setSystemUiVisibility(this.mOriginalSystemUiVisibility);
Shared.activity.setRequestedOrientation(this.mOriginalOrientation); activity.setRequestedOrientation(this.mOriginalOrientation);
this.mCustomViewCallback.onCustomViewHidden(); this.mCustomViewCallback.onCustomViewHidden();
this.mCustomViewCallback = null; this.mCustomViewCallback = null;
...@@ -96,18 +106,20 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -96,18 +106,20 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
} }
@Override @Override
public void onShowCustomView(View paramView, CustomViewCallback paramCustomViewCallback) { public void onShowCustomView(final View paramView, final CustomViewCallback paramCustomViewCallback) {
if (this.mCustomView != null) { if (this.mCustomView != null) {
onHideCustomView(); onHideCustomView();
return; return;
} }
View decorView = Shared.activity.getWindow().getDecorView();
Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
final View decorView = activity.getWindow().getDecorView();
this.mCustomView = paramView; this.mCustomView = paramView;
this.mOriginalSystemUiVisibility = decorView.getSystemUiVisibility(); this.mOriginalSystemUiVisibility = decorView.getSystemUiVisibility();
this.mOriginalOrientation = Shared.activity.getRequestedOrientation(); this.mOriginalOrientation = activity.getRequestedOrientation();
this.mCustomViewCallback = paramCustomViewCallback; this.mCustomViewCallback = paramCustomViewCallback;
this.mCustomView.setBackgroundColor(Color.parseColor("#000000")); this.mCustomView.setBackgroundColor(Color.parseColor("#000000"));
((FrameLayout) decorView).addView(this.mCustomView, new FrameLayout.LayoutParams(-1, -1)); ((FrameLayout) decorView).addView(this.mCustomView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.setSystemUiVisibility( decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
...@@ -200,7 +212,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -200,7 +212,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
} }
}; };
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity, R.style.Theme_AppCompat_Dialog_Alert);
alertDialogBuilder.setMessage(alertMessage); alertDialogBuilder.setMessage(alertMessage);
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) { if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
alertDialogBuilder.setPositiveButton(confirmButtonTitle, clickListener); alertDialogBuilder.setPositiveButton(confirmButtonTitle, clickListener);
...@@ -291,7 +305,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -291,7 +305,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
} }
}; };
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity, R.style.Theme_AppCompat_Dialog_Alert);
alertDialogBuilder.setMessage(alertMessage); alertDialogBuilder.setMessage(alertMessage);
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) { if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener); alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
...@@ -408,7 +424,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -408,7 +424,9 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
} }
}; };
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Shared.activity, R.style.Theme_AppCompat_Dialog_Alert); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity, R.style.Theme_AppCompat_Dialog_Alert);
alertDialogBuilder.setMessage(alertMessage); alertDialogBuilder.setMessage(alertMessage);
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) { if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener); alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
...@@ -561,13 +579,12 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -561,13 +579,12 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
// For Android 3.0+ // For Android 3.0+
public void openFileChooser(ValueCallback<Uri> uploadMsg) { public void openFileChooser(ValueCallback<Uri> uploadMsg) {
mUploadMessage = uploadMsg; mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT); Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE); i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*"); i.setType("image/*");
Shared.activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
} }
// For Android 3.0+ // For Android 3.0+
...@@ -576,7 +593,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -576,7 +593,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
Intent i = new Intent(Intent.ACTION_GET_CONTENT); Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE); i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*"); i.setType("*/*");
Shared.activity.startActivityForResult( Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
activity.startActivityForResult(
Intent.createChooser(i, "File Browser"), Intent.createChooser(i, "File Browser"),
FILECHOOSER_RESULTCODE); FILECHOOSER_RESULTCODE);
} }
...@@ -587,8 +605,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -587,8 +605,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
Intent i = new Intent(Intent.ACTION_GET_CONTENT); Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE); i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*"); i.setType("image/*");
Shared.activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
activity.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
} }
// For Android 5.0+ // For Android 5.0+
...@@ -605,7 +623,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR ...@@ -605,7 +623,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent); chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent);
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser"); chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray); chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
Shared.activity.startActivityForResult(chooserIntent, FILECHOOSER_RESULTCODE); Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
activity.startActivityForResult(chooserIntent, FILECHOOSER_RESULTCODE);
} catch (ActivityNotFoundException e) { } catch (ActivityNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
return false; return false;
......
...@@ -46,11 +46,7 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware { ...@@ -46,11 +46,7 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
binding.getApplicationContext(), binding.getBinaryMessenger(), null, binding.getPlatformViewRegistry(), null); binding.getApplicationContext(), binding.getBinaryMessenger(), null, binding.getPlatformViewRegistry(), null);
} }
private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger, Activity activity, PlatformViewRegistry platformViewRegistry, FlutterView flutterView) { private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger, Activity activity, PlatformViewRegistry platformViewRegistry, FlutterView flutterView) {
Log.d(LOG_TAG, "\n\n\n onAttachedToEngine CALLED! \n\n\n");
Shared.applicationContext = applicationContext; Shared.applicationContext = applicationContext;
Shared.activity = activity; Shared.activity = activity;
Shared.messenger = messenger; Shared.messenger = messenger;
...@@ -71,9 +67,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware { ...@@ -71,9 +67,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
@Override @Override
public void onDetachedFromEngine(FlutterPluginBinding binding) { public void onDetachedFromEngine(FlutterPluginBinding binding) {
Log.d(LOG_TAG, "\n\n\n onDetachedFromEngine CALLED! \n\n\n");
if (inAppBrowserManager != null) { if (inAppBrowserManager != null) {
inAppBrowserManager.dispose(); inAppBrowserManager.dispose();
inAppBrowserManager = null; inAppBrowserManager = null;
...@@ -107,36 +100,24 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware { ...@@ -107,36 +100,24 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
@Override @Override
public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) { public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) {
Log.d(LOG_TAG, "\n\n\n onAttachedToActivity CALLED! \n\n\n");
Shared.activityPluginBinding = activityPluginBinding; Shared.activityPluginBinding = activityPluginBinding;
Shared.activity = activityPluginBinding.getActivity(); Shared.activity = activityPluginBinding.getActivity();
} }
@Override @Override
public void onDetachedFromActivityForConfigChanges() { public void onDetachedFromActivityForConfigChanges() {
Log.d(LOG_TAG, "\n\n\n onDetachedFromActivityForConfigChanges CALLED! \n\n\n");
Shared.activityPluginBinding = null; Shared.activityPluginBinding = null;
Shared.activity = null; Shared.activity = null;
} }
@Override @Override
public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) { public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) {
Log.d(LOG_TAG, "\n\n\n onReattachedToActivityForConfigChanges CALLED! \n\n\n");
Shared.activityPluginBinding = activityPluginBinding; Shared.activityPluginBinding = activityPluginBinding;
Shared.activity = activityPluginBinding.getActivity(); Shared.activity = activityPluginBinding.getActivity();
} }
@Override @Override
public void onDetachedFromActivity() { public void onDetachedFromActivity() {
Log.d(LOG_TAG, "\n\n\n onDetachedFromActivity CALLED! \n\n\n");
Shared.activityPluginBinding = null; Shared.activityPluginBinding = null;
Shared.activity = null; Shared.activity = null;
} }
......
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"android":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_macos-0.1.0+3/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos"]},{"name":"connectivity_macos","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2020-05-22 16:46:33.343831","version":"1.17.1"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]}],"android":[{"name":"e2e","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/e2e-0.2.4+4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"e2e","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]}],"date_created":"2020-05-23 00:16:16.872956","version":"1.17.1"}
\ No newline at end of file \ No newline at end of file
...@@ -27,17 +27,22 @@ ...@@ -27,17 +27,22 @@
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<application <application
android:name=".MyApplication" android:name="io.flutter.app.FlutterApplication"
android:label="flutter_inappwebview_example" android:label="flutter_inappwebview_example"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<activity <activity
android:name=".EmbedderV1Activity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/InAppWebViewTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:exported="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:name=".EmbedderV1Activity"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing <!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if until Flutter renders its first frame. It can be removed if
...@@ -45,39 +50,30 @@ ...@@ -45,39 +50,30 @@
defined in @style/LaunchTheme). --> defined in @style/LaunchTheme). -->
<meta-data <meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" /> android:value="true"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity> </activity>
<activity <activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/InAppWebViewTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:name="io.flutter.embedding.android.FlutterActivity"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<!--<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>--> </intent-filter>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<!--<meta-data
android:name="flutterEmbedding"
android:value="2" />-->
</activity> </activity>
<provider <!-- <provider-->
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider" <!-- android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"-->
android:authorities="${applicationId}.flutter_downloader.provider" <!-- android:authorities="${applicationId}.flutter_downloader.provider"-->
android:exported="false" <!-- android:exported="false"-->
android:grantUriPermissions="true"> <!-- android:grantUriPermissions="true">-->
<meta-data <!-- <meta-data-->
android:name="android.support.FILE_PROVIDER_PATHS" <!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
android:resource="@xml/provider_paths"/> <!-- android:resource="@xml/provider_paths"/>-->
</provider> <!-- </provider>-->
</application> </application>
</manifest> </manifest>
package com.pichillilorenzo.flutterwebviewexample; package com.pichillilorenzo.flutterwebviewexample;
import android.os.Bundle; import android.os.Bundle;
import android.view.ActionMode; import dev.flutter.plugins.e2e.E2EPlugin;
import android.view.Menu;
import io.flutter.Log;
import io.flutter.app.FlutterActivity; import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant; import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
public class EmbedderV1Activity extends FlutterActivity { public class EmbedderV1Activity extends FlutterActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this); E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin"));
InAppWebViewFlutterPlugin.registerWith(
registrarFor("com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin"));
} }
} }
\ No newline at end of file
package com.pichillilorenzo.flutterwebviewexample;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MyApplication extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback {
@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
}
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter" export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example" export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart" export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios" export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter" export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1" export "FLUTTER_BUILD_NUMBER=1"
export "TRACK_WIDGET_CREATION=true"
...@@ -20,14 +20,15 @@ dependencies: ...@@ -20,14 +20,15 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
flutter_downloader: ^1.3.2 # flutter_downloader: ^1.3.2
path_provider: ^1.4.0 # path_provider: ^1.4.0
permission_handler: ^3.3.0 # permission_handler: ^3.3.0
connectivity: ^0.4.5+6 # connectivity: ^0.4.5+6
flutter_inappwebview: flutter_inappwebview:
path: ../ path: ../
dev_dependencies: dev_dependencies:
e2e: "^0.2.0"
flutter_driver: flutter_driver:
sdk: flutter sdk: flutter
test: any test: any
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment