Skip to content

Commit 2a7fcc3

Browse files
committed
feat: migrate to capacitor v7
1 parent 5963dff commit 2a7fcc3

10 files changed

+4901
-30
lines changed

.prettierignore

-2
This file was deleted.

CapgoInappbrowser.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.author = package['author']
1212
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
1313
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14-
s.ios.deployment_target = '13.0'
14+
s.ios.deployment_target = '14.0'
1515
s.dependency 'Capacitor'
1616
s.swift_version = '5.1'
1717
end

android/build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ext {
22
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
6-
androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.7.0'
3+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6+
androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.8.0'
77
}
88

99
buildscript {
@@ -20,10 +20,10 @@ apply plugin: 'com.android.library'
2020

2121
android {
2222
namespace "ee.forgr.capacitor_inappbrowser"
23-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
23+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
2424
defaultConfig {
25-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
26-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
25+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
26+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
2727
versionCode 1
2828
versionName "1.0"
2929
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -38,8 +38,8 @@ android {
3838
abortOnError false
3939
}
4040
compileOptions {
41-
sourceCompatibility JavaVersion.VERSION_17
42-
targetCompatibility JavaVersion.VERSION_17
41+
sourceCompatibility JavaVersion.VERSION_21
42+
targetCompatibility JavaVersion.VERSION_21
4343
}
4444
}
4545

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/gradlew

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
9091

9192
# Use the maximum available, or set MAX_FD != -1 to use that value.
9293
MAX_FD=maximum

ios/Plugin.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
388388
GCC_WARN_UNUSED_FUNCTION = YES;
389389
GCC_WARN_UNUSED_VARIABLE = YES;
390-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
390+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
391391
MTL_ENABLE_DEBUG_INFO = YES;
392392
ONLY_ACTIVE_ARCH = YES;
393393
SDKROOT = iphoneos;
@@ -447,7 +447,7 @@
447447
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
448448
GCC_WARN_UNUSED_FUNCTION = YES;
449449
GCC_WARN_UNUSED_VARIABLE = YES;
450-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
450+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
451451
MTL_ENABLE_DEBUG_INFO = NO;
452452
SDKROOT = iphoneos;
453453
SWIFT_COMPILATION_MODE = wholemodule;
@@ -471,7 +471,7 @@
471471
DYLIB_INSTALL_NAME_BASE = "@rpath";
472472
INFOPLIST_FILE = Plugin/Info.plist;
473473
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
474-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
474+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
475475
LD_RUNPATH_SEARCH_PATHS = (
476476
"$(inherited)",
477477
"@executable_path/Frameworks",
@@ -504,7 +504,7 @@
504504
DYLIB_INSTALL_NAME_BASE = "@rpath";
505505
INFOPLIST_FILE = Plugin/Info.plist;
506506
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
507-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
507+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
508508
LD_RUNPATH_SEARCH_PATHS = (
509509
"$(inherited)",
510510
"@executable_path/Frameworks",

ios/Plugin/WKWebViewController.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,14 @@ fileprivate extension WKWebViewController {
838838

839839
// MARK: - WKUIDelegate
840840
extension WKWebViewController: WKUIDelegate {
841-
841+
public func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
842+
// Ensure UI updates are on the main thread
843+
DispatchQueue.main.async {
844+
let alertController = UIAlertController(title: nil, message: message, preferredStyle: .alert)
845+
self.present(alertController, animated: true, completion: nil)
846+
}
847+
completionHandler()
848+
}
842849
}
843850

844851
// MARK: - WKNavigationDelegate

ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :ios, '13.0'
1+
platform :ios, '14.0'
22

33
def capacitor_pods
44
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks

0 commit comments

Comments
 (0)