Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.24.5

* Reverts `3.24.4` to prevent missing `FlutterSceneLifeCycleDelegate` build error.

## 3.24.4

* Updates plugin to prevent message calls when application will terminate.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,13 @@ public class WebViewFlutterPlugin: NSObject, FlutterPlugin {
let plugin = WebViewFlutterPlugin(binaryMessenger: binaryMessenger)

let viewFactory = FlutterViewFactory(instanceManager: plugin.proxyApiRegistrar!.instanceManager)

#if os(iOS)
registrar.addApplicationDelegate(plugin)
registrar.addSceneDelegate(plugin)
#endif

registrar.register(viewFactory, withId: "plugins.flutter.io/webview")
registrar.publish(plugin)
}

public func detachFromEngine(for registrar: FlutterPluginRegistrar) {
tearDownProxyAPIRegistrar()
}

private func tearDownProxyAPIRegistrar() {
proxyApiRegistrar?.ignoreCallsToDart = true
proxyApiRegistrar?.tearDown()
try? proxyApiRegistrar?.instanceManager.removeAllObjects()
proxyApiRegistrar!.ignoreCallsToDart = true
proxyApiRegistrar!.tearDown()
Comment on lines +36 to +37
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of force unwrapping (!) on proxyApiRegistrar is unsafe. If detachFromEngine is called when proxyApiRegistrar is already nil, the application will crash. It is safer to use optional chaining (?), which was the pattern used in the code being reverted.

Suggested change
proxyApiRegistrar!.ignoreCallsToDart = true
proxyApiRegistrar!.tearDown()
proxyApiRegistrar?.ignoreCallsToDart = true
proxyApiRegistrar?.tearDown()

proxyApiRegistrar = nil
}
}

#if os(iOS)
extension WebViewFlutterPlugin: FlutterApplicationLifeCycleDelegate, FlutterSceneLifeCycleDelegate
{
public func applicationWillTerminate(_ application: UIApplication) {
tearDownProxyAPIRegistrar()
}

public func sceneDidDisconnect(_ scene: UIScene) {
tearDownProxyAPIRegistrar()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -42,8 +42,6 @@
8F1488FE2D2DE27000191744 /* HTTPCookieProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488C82D2DE27000191744 /* HTTPCookieProxyAPITests.swift */; };
8F1488FF2D2DE27000191744 /* NavigationActionProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1488CB2D2DE27000191744 /* NavigationActionProxyAPITests.swift */; };
8F1489012D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */; };
8F63D06B2F8812E400EC5076 /* WebViewFlutterPluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F63D06A2F8812E400EC5076 /* WebViewFlutterPluginTests.swift */; };
8F63D06C2F8812E400EC5076 /* PlatformViewImplTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F63D0692F8812E400EC5076 /* PlatformViewImplTests.swift */; };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The reference to PlatformViewImplTests.swift is being removed from the Xcode project, but the file itself is not included in the deletion list of this pull request. This will result in an orphaned file in the repository. Please ensure that all files associated with the reverted change are physically deleted.

8FEC64852DA2C6DC00C48569 /* GetTrustResultResponseProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FEC64812DA2C6DC00C48569 /* GetTrustResultResponseProxyAPITests.swift */; };
8FEC64862DA2C6DC00C48569 /* WebpagePreferencesProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FEC64842DA2C6DC00C48569 /* WebpagePreferencesProxyAPITests.swift */; };
8FEC64872DA2C6DC00C48569 /* SecCertificateProxyAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FEC64822DA2C6DC00C48569 /* SecCertificateProxyAPITests.swift */; };
Expand Down Expand Up @@ -130,8 +128,6 @@
8F1488E02D2DE27000191744 /* WebViewConfigurationProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewConfigurationProxyAPITests.swift; path = ../../darwin/Tests/WebViewConfigurationProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
8F1488E12D2DE27000191744 /* WebViewProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewProxyAPITests.swift; path = ../../darwin/Tests/WebViewProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
8F1489002D2DE91C00191744 /* AuthenticationChallengeResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AuthenticationChallengeResponseProxyAPITests.swift; path = ../../darwin/Tests/AuthenticationChallengeResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
8F63D0692F8812E400EC5076 /* PlatformViewImplTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PlatformViewImplTests.swift; path = ../../darwin/Tests/PlatformViewImplTests.swift; sourceTree = SOURCE_ROOT; };
8F63D06A2F8812E400EC5076 /* WebViewFlutterPluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebViewFlutterPluginTests.swift; path = ../../darwin/Tests/WebViewFlutterPluginTests.swift; sourceTree = SOURCE_ROOT; };
8FEC64812DA2C6DC00C48569 /* GetTrustResultResponseProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GetTrustResultResponseProxyAPITests.swift; path = ../../darwin/Tests/GetTrustResultResponseProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
8FEC64822DA2C6DC00C48569 /* SecCertificateProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecCertificateProxyAPITests.swift; path = ../../darwin/Tests/SecCertificateProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
8FEC64832DA2C6DC00C48569 /* SecTrustProxyAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecTrustProxyAPITests.swift; path = ../../darwin/Tests/SecTrustProxyAPITests.swift; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -178,8 +174,6 @@
68BDCAEA23C3F7CB00D9C032 /* RunnerTests */ = {
isa = PBXGroup;
children = (
8F63D0692F8812E400EC5076 /* PlatformViewImplTests.swift */,
8F63D06A2F8812E400EC5076 /* WebViewFlutterPluginTests.swift */,
8F0E23512EEB5D6B002AB342 /* ColorProxyAPITests.swift */,
8F0EDFD22E1F4967001938E6 /* ProxyAPIRegistrarTests.swift */,
8FEC64812DA2C6DC00C48569 /* GetTrustResultResponseProxyAPITests.swift */,
Expand Down Expand Up @@ -504,8 +498,6 @@
8F1488F42D2DE27000191744 /* URLCredentialProxyAPITests.swift in Sources */,
8F1488F52D2DE27000191744 /* URLAuthenticationChallengeProxyAPITests.swift in Sources */,
8F1488F62D2DE27000191744 /* NavigationDelegateProxyAPITests.swift in Sources */,
8F63D06B2F8812E400EC5076 /* WebViewFlutterPluginTests.swift in Sources */,
8F63D06C2F8812E400EC5076 /* PlatformViewImplTests.swift in Sources */,
8F1488F72D2DE27000191744 /* UIDelegateProxyAPITests.swift in Sources */,
8F1488F82D2DE27000191744 /* ScrollViewDelegateProxyAPITests.swift in Sources */,
8F1488FA2D2DE27000191744 /* FWFWebViewFlutterWKWebViewExternalAPITests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 3.24.4
version: 3.24.5

environment:
sdk: ^3.9.0
Expand Down
Loading