Skip to content

Commit b5c9ecf

Browse files
authored
Merge pull request #69 from fumito-ito/fix/exessibe-calls-to-open-url
Remove excessive `UIApplication.shared.open` calls.
2 parents c3a4389 + 6a079fc commit b5c9ecf

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

Sources/SwiftyInAppMessaging/Default/Banner/InAppDefaultBannerMessageViewControlller.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@
134134
actionText: self?.title, actionURL: self?.actionURL)
135135
self?.eventDetector.messageClicked(with: action)
136136
})
137-
138-
UIApplication.shared.open(url, options: [:], completionHandler: nil)
139137
}
140138
}
141139

Sources/SwiftyInAppMessaging/Default/Card/InAppDefaultCardMessageViewController.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,12 @@
175175

176176
extension InAppDefaultCardMessageViewController: InAppDefaultCardMessageViewDelegate {
177177
public func primaryActionButtonDidTap() {
178-
179-
if let actionURL = self.primaryActionURL, UIApplication.shared.canOpenURL(actionURL) {
180-
UIApplication.shared.open(actionURL, options: [:], completionHandler: nil)
181-
}
182-
183178
let action = InAppMessagingAction(
184179
actionText: self.primaryActionButtonText, actionURL: self.primaryActionURL)
185180
eventDetector.messageClicked(with: action)
186181
}
187182

188183
public func secondaryActionButtonDidTap() {
189-
190-
if let actionURL = self.secondaryActionURL, UIApplication.shared.canOpenURL(actionURL) {
191-
UIApplication.shared.open(actionURL, options: [:], completionHandler: nil)
192-
}
193-
194184
let action = InAppMessagingAction(
195185
actionText: self.secondaryActionButtonText, actionURL: self.secondaryActionURL)
196186
eventDetector.messageClicked(with: action)

Sources/SwiftyInAppMessaging/Default/ImageOnly/InAppDefaultImageOnlyMessageViewController.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@
140140

141141
extension InAppDefaultImageOnlyMessageViewController: InAppDefaultImageOnlyViewDelegate {
142142
public func imageDidTap() {
143-
if let actionURL = self.actionURL, UIApplication.shared.canOpenURL(actionURL) {
144-
UIApplication.shared.open(actionURL, options: [:], completionHandler: nil)
145-
}
146-
147143
let action = InAppMessagingAction(actionText: nil, actionURL: self.actionURL)
148144
eventDetector.messageClicked(with: action)
149145
}

Sources/SwiftyInAppMessaging/Default/Modal/InAppDefaultModalMessageViewController.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@
152152

153153
extension InAppDefaultModalMessageViewController: InAppDefaultModalViewDelegate {
154154
public func actionButtonDidTap() {
155-
156-
if let actionURL = self.actionURL, UIApplication.shared.canOpenURL(actionURL) {
157-
UIApplication.shared.open(actionURL, options: [:], completionHandler: nil)
158-
}
159-
160155
let action = InAppMessagingAction(
161156
actionText: self.actionButtonText, actionURL: self.actionURL)
162157
eventDetector.messageClicked(with: action)

0 commit comments

Comments
 (0)