Skip to content

Commit 538e72a

Browse files
committed
SDK changes:
- handle opening extra links in survey window - update iOS target version to 10.0
1 parent f44159b commit 538e72a

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

Example/Example.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343343
GCC_WARN_UNUSED_FUNCTION = YES;
344344
GCC_WARN_UNUSED_VARIABLE = YES;
345-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
345+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
346346
MTL_ENABLE_DEBUG_INFO = YES;
347347
ONLY_ACTIVE_ARCH = YES;
348348
SDKROOT = iphoneos;
@@ -395,7 +395,7 @@
395395
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
396396
GCC_WARN_UNUSED_FUNCTION = YES;
397397
GCC_WARN_UNUSED_VARIABLE = YES;
398-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
398+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
399399
MTL_ENABLE_DEBUG_INFO = NO;
400400
SDKROOT = iphoneos;
401401
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -411,7 +411,7 @@
411411
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
412412
DEVELOPMENT_TEAM = "";
413413
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
414-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
414+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
415415
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
416416
PRODUCT_BUNDLE_IDENTIFIER = com.userreport.example;
417417
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -428,7 +428,7 @@
428428
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
429429
DEVELOPMENT_TEAM = "";
430430
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
431-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
431+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
432432
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
433433
PRODUCT_BUNDLE_IDENTIFIER = com.userreport.example;
434434
PRODUCT_NAME = "$(TARGET_NAME)";

Example_Objective-C/Example_Objective-C.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
269269
GCC_WARN_UNUSED_FUNCTION = YES;
270270
GCC_WARN_UNUSED_VARIABLE = YES;
271-
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
271+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
272272
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
273273
MTL_FAST_MATH = YES;
274274
ONLY_ACTIVE_ARCH = YES;
@@ -321,7 +321,7 @@
321321
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
322322
GCC_WARN_UNUSED_FUNCTION = YES;
323323
GCC_WARN_UNUSED_VARIABLE = YES;
324-
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
324+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
325325
MTL_ENABLE_DEBUG_INFO = NO;
326326
MTL_FAST_MATH = YES;
327327
SDKROOT = iphoneos;

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/UserReport.svg)](https://cocoapods.org/pods/UserReport)
44
[![Platform](https://img.shields.io/cocoapods/p/UserReport.svg?style=flat)](http://cocoadocs.org/docsets/UserReport)
55
![Xcode 9.0](https://img.shields.io/badge/Xcode-9.0-blue.svg)
6-
![iOS 9.0+](https://img.shields.io/badge/iOS-9.0%2B-blue.svg)
6+
![iOS 10.0+](https://img.shields.io/badge/iOS-10.0%2B-blue.svg)
77
![Swift 4.2](https://img.shields.io/badge/Swift-4.2-orange.svg)
88
[![License](https://img.shields.io/cocoapods/l/UserReport.svg)](https://raw.githubusercontent.com/AudienceProject/userreport-ios-sdk/master/LICENSE)
99

1010

1111

1212
## Requirements
1313
- Xcode 9.0+
14-
- iOS 9.0+
14+
- iOS 10.0+
1515

1616
## Installation
1717
UserReport iOS SDK can be installed in various ways.

UserReport.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "UserReport"
19-
s.version = "0.0.7"
19+
s.version = "0.0.8"
2020
s.summary = "UserReport SDK for iOS."
2121

2222
# This description is used to generate tags and improve search results.
@@ -61,7 +61,7 @@ Pod::Spec.new do |s|
6161
# the deployment target. You can optionally include the target after the platform.
6262
#
6363

64-
s.platform = :ios, "9.0"
64+
s.platform = :ios, "10.0"
6565

6666

6767
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

UserReport/UserReport.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@
421421
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
422422
GCC_WARN_UNUSED_FUNCTION = YES;
423423
GCC_WARN_UNUSED_VARIABLE = YES;
424-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
424+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
425425
MTL_ENABLE_DEBUG_INFO = YES;
426426
ONLY_ACTIVE_ARCH = YES;
427427
SDKROOT = iphoneos;
@@ -478,7 +478,7 @@
478478
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
479479
GCC_WARN_UNUSED_FUNCTION = YES;
480480
GCC_WARN_UNUSED_VARIABLE = YES;
481-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
481+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
482482
MTL_ENABLE_DEBUG_INFO = NO;
483483
SDKROOT = iphoneos;
484484
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -500,7 +500,7 @@
500500
DYLIB_INSTALL_NAME_BASE = "@rpath";
501501
INFOPLIST_FILE = UserReport/Info.plist;
502502
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
503-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
503+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
504504
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
505505
PRODUCT_BUNDLE_IDENTIFIER = com.userreport;
506506
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -521,7 +521,7 @@
521521
DYLIB_INSTALL_NAME_BASE = "@rpath";
522522
INFOPLIST_FILE = UserReport/Info.plist;
523523
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
524-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
524+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
525525
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
526526
PRODUCT_BUNDLE_IDENTIFIER = com.userreport;
527527
PRODUCT_NAME = "$(TARGET_NAME)";

UserReport/UserReport/UI/SurveyViewController.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,21 @@ internal class SurveyViewController: UIViewController, WKNavigationDelegate, WKS
132132
self.loadDidFail?(error)
133133
}
134134

135+
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) {
136+
if navigationAction.navigationType == WKNavigationType.linkActivated {
137+
if let url = navigationAction.request.url {
138+
let shared = UIApplication.shared
139+
if shared.canOpenURL(url) {
140+
shared.open(url, options: [:], completionHandler: nil)
141+
}
142+
}
143+
decisionHandler(.cancel)
144+
}
145+
else {
146+
decisionHandler(.allow)
147+
}
148+
}
149+
135150
// MARK: - WKScriptMessageHandler
136151

137152
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {

0 commit comments

Comments
 (0)