diff --git a/ios/Classes/TiWebdialogModule.m b/ios/Classes/TiWebdialogModule.m index c001d67..3e2c206 100644 --- a/ios/Classes/TiWebdialogModule.m +++ b/ios/Classes/TiWebdialogModule.m @@ -62,13 +62,19 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller - (SFSafariViewController *)safariController:(NSString *)url withEntersReaderIfAvailable:(BOOL)entersReaderIfAvailable andBarCollapsingEnabled:(BOOL)barCollapsingEnabled { if (_safariController == nil) { - NSURL *safariURL = [NSURL URLWithString:[url stringByRemovingPercentEncoding]]; - SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; - config.entersReaderIfAvailable = entersReaderIfAvailable; - config.barCollapsingEnabled = barCollapsingEnabled; + NSURL *safariURL = [NSURL URLWithString:[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + if (@available(iOS 11.0, *)) { + SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; + config.entersReaderIfAvailable = entersReaderIfAvailable; + config.barCollapsingEnabled = barCollapsingEnabled; + + _safariController = [[SFSafariViewController alloc] initWithURL:safariURL + configuration:config]; + } else { + _safariController = [[SFSafariViewController alloc] initWithURL:safariURL + entersReaderIfAvailable:entersReaderIfAvailable]; + } - _safariController = [[SFSafariViewController alloc] initWithURL:safariURL - configuration:config]; [_safariController setDelegate:self]; } @@ -152,7 +158,11 @@ - (void)open:(id)args } if ([args objectForKey:@"dismissButtonStyle"]) { - [safari setDismissButtonStyle:[TiUtils intValue:@"dismissButtonStyle" properties:args def:SFSafariViewControllerDismissButtonStyleDone]]; + if (@available(iOS 11.0, *)) { + [safari setDismissButtonStyle:[TiUtils intValue:@"dismissButtonStyle" properties:args def:SFSafariViewControllerDismissButtonStyleDone]]; + } else { + NSLog(@"[ERROR] Ti.WebDialog: The dismissButtonStyle property is only available in iOS 11 and later"); + } } [[TiApp app] showModalController:safari diff --git a/ios/manifest b/ios/manifest index 0f21cf4..8a9b8e4 100644 --- a/ios/manifest +++ b/ios/manifest @@ -2,9 +2,9 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 3.0.0 +version: 3.0.1 apiversion: 2 -architectures: arm64 x86_64 +architectures: armv7 arm64 i386 x86_64 description: titanium-web-dialog author: Hans Knoechel license: Apache 2.0 diff --git a/ios/titanium-web-dialog.xcodeproj/project.pbxproj b/ios/titanium-web-dialog.xcodeproj/project.pbxproj index cea4847..331a55a 100644 --- a/ios/titanium-web-dialog.xcodeproj/project.pbxproj +++ b/ios/titanium-web-dialog.xcodeproj/project.pbxproj @@ -243,7 +243,7 @@ GCC_WARN_UNUSED_VALUE = NO; GCC_WARN_UNUSED_VARIABLE = NO; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ""; OTHER_CFLAGS = ( "-DDEBUG", @@ -289,7 +289,7 @@ GCC_WARN_UNUSED_VALUE = NO; GCC_WARN_UNUSED_VARIABLE = NO; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ""; OTHER_CFLAGS = "-DTI_POST_1_2"; OTHER_LDFLAGS = "-ObjC"; @@ -325,7 +325,6 @@ GCC_WARN_UNUSED_VALUE = NO; GCC_WARN_UNUSED_VARIABLE = NO; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DDEBUG", @@ -364,7 +363,7 @@ GCC_WARN_UNUSED_VALUE = NO; GCC_WARN_UNUSED_VARIABLE = NO; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DTI_POST_1_2"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = ti.webdialog; diff --git a/package-lock.json b/package-lock.json index 9864843..0b3eb8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@titanium-sdk/ti.webdialog", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@titanium-sdk/ti.webdialog", - "version": "4.0.0", + "version": "4.0.1", "hasInstallScript": true, "devDependencies": { "@commitlint/cli": "^12.0.0", diff --git a/package.json b/package.json index 6ab22df..278e46c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@titanium-sdk/ti.webdialog", - "version": "4.0.0", + "version": "4.0.1", "description": "Use the native `SFSafariViewController` (iOS) and `Chrome Pages` (Android) within Axway Titanium.", "scripts": { "commit": "git-cz",