updated README.md
This commit is contained in:
parent
e1e1574d9e
commit
463b95c32f
CHANGELOG.mdREADME.md
android/src/main/java/com/pichillilorenzo/flutter_inappwebview
InAppWebView
InAppWebViewFlutterPlugin.javaexample
.flutter-plugins-dependencies
android/app/src/main
AndroidManifest.xml
java/com/pichillilorenzo/flutterwebviewexample
ios/Flutter
pubspec.yaml@ -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 `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 `onJsAlert`, `onJsConfirm`, `onJsPrompt` for `InAppBrowser` on Android
|
||||
|
||||
## 3.2.0
|
||||
|
||||
|
48
README.md
48
README.md
@ -22,7 +22,19 @@ If you are starting a new fresh app, you need to create the Flutter App with `fl
|
||||
|
||||
During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library`, it means that you need to update the `minSdkVersion` of your `android/app/build.gradle` file to at least `17`.
|
||||
|
||||
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`.
|
||||
|
||||
@ -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).
|
||||
|
||||
**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
|
||||
|
||||
For help getting started with Flutter, view our online
|
||||
|
@ -54,8 +54,6 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
||||
InAppWebViewOptions options = new InAppWebViewOptions();
|
||||
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);
|
||||
displayListenerProxy.onPostWebViewInitialization(displayManager);
|
||||
|
||||
|
@ -1496,12 +1496,6 @@ final public class InAppWebView extends InputAwareWebView {
|
||||
sendOnCreateContextMenuEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIsTextEditor() {
|
||||
Log.d(LOG_TAG, "onCheckIsTextEditor");
|
||||
return super.onCheckIsTextEditor();
|
||||
}
|
||||
|
||||
private void sendOnCreateContextMenuEvent() {
|
||||
HitTestResult hitTestResult = getHitTestResult();
|
||||
Map<String, Object> hitTestResultMap = new HashMap<>();
|
||||
|
@ -1,17 +1,25 @@
|
||||
package com.pichillilorenzo.flutter_inappwebview.InAppWebView;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.ConsoleMessage;
|
||||
import android.webkit.GeolocationPermissions;
|
||||
import android.webkit.JsPromptResult;
|
||||
@ -76,16 +84,18 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
if (mCustomView == 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
|
||||
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);
|
||||
this.mCustomView = null;
|
||||
decorView.setSystemUiVisibility(this.mOriginalSystemUiVisibility);
|
||||
Shared.activity.setRequestedOrientation(this.mOriginalOrientation);
|
||||
activity.setRequestedOrientation(this.mOriginalOrientation);
|
||||
this.mCustomViewCallback.onCustomViewHidden();
|
||||
this.mCustomViewCallback = null;
|
||||
|
||||
@ -96,18 +106,20 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowCustomView(View paramView, CustomViewCallback paramCustomViewCallback) {
|
||||
public void onShowCustomView(final View paramView, final CustomViewCallback paramCustomViewCallback) {
|
||||
if (this.mCustomView != null) {
|
||||
onHideCustomView();
|
||||
return;
|
||||
}
|
||||
View decorView = Shared.activity.getWindow().getDecorView();
|
||||
|
||||
Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
|
||||
final View decorView = activity.getWindow().getDecorView();
|
||||
this.mCustomView = paramView;
|
||||
this.mOriginalSystemUiVisibility = decorView.getSystemUiVisibility();
|
||||
this.mOriginalOrientation = Shared.activity.getRequestedOrientation();
|
||||
this.mOriginalOrientation = activity.getRequestedOrientation();
|
||||
this.mCustomViewCallback = paramCustomViewCallback;
|
||||
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) {
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
@ -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);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, clickListener);
|
||||
@ -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);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
|
||||
@ -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);
|
||||
if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {
|
||||
alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);
|
||||
@ -561,13 +579,12 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
|
||||
// For Android 3.0+
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
|
||||
|
||||
mUploadMessage = uploadMsg;
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
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+
|
||||
@ -576,7 +593,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
i.setType("*/*");
|
||||
Shared.activity.startActivityForResult(
|
||||
Activity activity = inAppBrowserActivity != null ? inAppBrowserActivity : Shared.activity;
|
||||
activity.startActivityForResult(
|
||||
Intent.createChooser(i, "File Browser"),
|
||||
FILECHOOSER_RESULTCODE);
|
||||
}
|
||||
@ -587,8 +605,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
i.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
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+
|
||||
@ -605,7 +623,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||
chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent);
|
||||
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
|
||||
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) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
|
@ -46,11 +46,7 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
|
||||
binding.getApplicationContext(), binding.getBinaryMessenger(), null, binding.getPlatformViewRegistry(), null);
|
||||
}
|
||||
|
||||
|
||||
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.activity = activity;
|
||||
Shared.messenger = messenger;
|
||||
@ -71,9 +67,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
|
||||
|
||||
@Override
|
||||
public void onDetachedFromEngine(FlutterPluginBinding binding) {
|
||||
|
||||
Log.d(LOG_TAG, "\n\n\n onDetachedFromEngine CALLED! \n\n\n");
|
||||
|
||||
if (inAppBrowserManager != null) {
|
||||
inAppBrowserManager.dispose();
|
||||
inAppBrowserManager = null;
|
||||
@ -107,36 +100,24 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
|
||||
|
||||
@Override
|
||||
public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) {
|
||||
|
||||
Log.d(LOG_TAG, "\n\n\n onAttachedToActivity CALLED! \n\n\n");
|
||||
|
||||
Shared.activityPluginBinding = activityPluginBinding;
|
||||
Shared.activity = activityPluginBinding.getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivityForConfigChanges() {
|
||||
|
||||
Log.d(LOG_TAG, "\n\n\n onDetachedFromActivityForConfigChanges CALLED! \n\n\n");
|
||||
|
||||
Shared.activityPluginBinding = null;
|
||||
Shared.activity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) {
|
||||
|
||||
Log.d(LOG_TAG, "\n\n\n onReattachedToActivityForConfigChanges CALLED! \n\n\n");
|
||||
|
||||
Shared.activityPluginBinding = activityPluginBinding;
|
||||
Shared.activity = activityPluginBinding.getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivity() {
|
||||
|
||||
Log.d(LOG_TAG, "\n\n\n onDetachedFromActivity CALLED! \n\n\n");
|
||||
|
||||
Shared.activityPluginBinding = null;
|
||||
Shared.activity = null;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"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"}
|
@ -27,17 +27,22 @@
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="flutter_inappwebview_example"
|
||||
android:usesCleartextTraffic="true"
|
||||
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
|
||||
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:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:name=".EmbedderV1Activity"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- This keeps the window background of the activity showing
|
||||
until Flutter renders its first frame. It can be removed if
|
||||
@ -45,39 +50,30 @@
|
||||
defined in @style/LaunchTheme). -->
|
||||
<meta-data
|
||||
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
|
||||
android:value="true" />
|
||||
android:value="true"/>
|
||||
</activity>
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:name="io.flutter.embedding.android.FlutterActivity"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/InAppWebViewTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!--<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</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>
|
||||
|
||||
<provider
|
||||
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
|
||||
android:authorities="${applicationId}.flutter_downloader.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths"/>
|
||||
</provider>
|
||||
<!-- <provider-->
|
||||
<!-- android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"-->
|
||||
<!-- android:authorities="${applicationId}.flutter_downloader.provider"-->
|
||||
<!-- android:exported="false"-->
|
||||
<!-- android:grantUriPermissions="true">-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
|
||||
<!-- android:resource="@xml/provider_paths"/>-->
|
||||
<!-- </provider>-->
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
11
example/android/app/src/main/java/com/pichillilorenzo/flutterwebviewexample/EmbedderV1Activity.java
11
example/android/app/src/main/java/com/pichillilorenzo/flutterwebviewexample/EmbedderV1Activity.java
@ -1,17 +1,16 @@
|
||||
package com.pichillilorenzo.flutterwebviewexample;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.ActionMode;
|
||||
import android.view.Menu;
|
||||
|
||||
import io.flutter.Log;
|
||||
import dev.flutter.plugins.e2e.E2EPlugin;
|
||||
import io.flutter.app.FlutterActivity;
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
||||
|
||||
public class EmbedderV1Activity extends FlutterActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
GeneratedPluginRegistrant.registerWith(this);
|
||||
E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin"));
|
||||
InAppWebViewFlutterPlugin.registerWith(
|
||||
registrarFor("com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin"));
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
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 @@
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
|
||||
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 "SYMROOT=${SOURCE_ROOT}/../build/ios"
|
||||
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
|
||||
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
|
@ -20,14 +20,15 @@ dependencies:
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.2
|
||||
flutter_downloader: ^1.3.2
|
||||
path_provider: ^1.4.0
|
||||
permission_handler: ^3.3.0
|
||||
connectivity: ^0.4.5+6
|
||||
# flutter_downloader: ^1.3.2
|
||||
# path_provider: ^1.4.0
|
||||
# permission_handler: ^3.3.0
|
||||
# connectivity: ^0.4.5+6
|
||||
flutter_inappwebview:
|
||||
path: ../
|
||||
|
||||
dev_dependencies:
|
||||
e2e: "^0.2.0"
|
||||
flutter_driver:
|
||||
sdk: flutter
|
||||
test: any
|
||||
|
Loading…
x
Reference in New Issue
Block a user