Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to deprecated v1 Android embedding #2176

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flutter_inappwebview/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fixed XCode 16 build
- Removed unsupported WebViewFeature.SUPPRESS_ERROR_PAGE
- Merged "Add privacy manifest for iOS" [#2029](https://github.com/pichillilorenzo/flutter_inappwebview/pull/2029) (thanks to [ueman](https://github.com/ueman))
- Merged "Remove references to deprecated v1 Android embedding" [#2176](https://github.com/pichillilorenzo/flutter_inappwebview/pull/2176) (thanks to [gmackall](https://github.com/gmackall))

## 6.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:label="flutter_inappwebview_example"
android:usesCleartextTraffic="true"
Expand All @@ -38,22 +33,6 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- <activity-->
<!-- 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">-->
<!-- &lt;!&ndash; This keeps the window background of the activity showing-->
<!-- until Flutter renders its first frame. It can be removed if-->
<!-- there is no splash screen (such as the default splash screen-->
<!-- defined in @style/LaunchTheme). &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"-->
<!-- android:value="true"/>-->
<!-- </activity>-->
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.platform.PlatformViewRegistry;
import io.flutter.view.FlutterView;
import io.flutter.embedding.android.FlutterView;

public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {

Expand Down Expand Up @@ -64,7 +63,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
public ProcessGlobalConfigManager processGlobalConfigManager;
public FlutterWebViewFactory flutterWebViewFactory;
public Context applicationContext;
public PluginRegistry.Registrar registrar;
public BinaryMessenger messenger;
public FlutterPlugin.FlutterAssets flutterAssets;
@Nullable
Expand All @@ -76,14 +74,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {

public InAppWebViewFlutterPlugin() {}

@SuppressWarnings("deprecation")
public static void registerWith(PluginRegistry.Registrar registrar) {
final InAppWebViewFlutterPlugin instance = new InAppWebViewFlutterPlugin();
instance.registrar = registrar;
instance.onAttachedToEngine(
registrar.context(), registrar.messenger(), registrar.activity(), registrar.platformViewRegistry(), registrar.view());
}

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {
this.flutterAssets = binding.getFlutterAssets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class Util {
private Util() {}

public static String getUrlAsset(InAppWebViewFlutterPlugin plugin, String assetFilePath) throws IOException {
String key = (plugin.registrar != null) ? plugin.registrar.lookupKeyForAsset(assetFilePath) : plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
String key = plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
InputStream is = null;
IOException e = null;

Expand All @@ -91,7 +91,7 @@ public static String getUrlAsset(InAppWebViewFlutterPlugin plugin, String assetF
}

public static InputStream getFileAsset(InAppWebViewFlutterPlugin plugin, String assetFilePath) throws IOException {
String key = (plugin.registrar != null) ? plugin.registrar.lookupKeyForAsset(assetFilePath) : plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
String key = plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
AssetManager mg = plugin.applicationContext.getResources().getAssets();
return mg.open(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ public InAppWebViewChromeClient(@NonNull final InAppWebViewFlutterPlugin plugin,
this.inAppBrowserDelegate.getActivityResultListeners().add(this);
}

if (plugin.registrar != null)
plugin.registrar.addActivityResultListener(this);
else if (plugin.activityPluginBinding != null)
if (plugin.activityPluginBinding != null)
plugin.activityPluginBinding.addActivityResultListener(this);
}

Expand Down
Loading