Skip to content

Commit 3515e9c

Browse files
committed
Merge remote-tracking branch 'origin/release/3.17.0'
2 parents b751c42 + 4c316ff commit 3515e9c

34 files changed

Lines changed: 542 additions & 66 deletions

Adapty.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Adapty'
3-
s.version = '3.15.7'
3+
s.version = '3.17.0'
44
s.summary = 'Adapty SDK for iOS.'
55

66
s.description = <<-DESC

AdaptyLogger.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AdaptyLogger'
3-
s.version = '3.15.7'
3+
s.version = '3.17.0'
44
s.summary = 'Adapty Logger for iOS.'
55

66
s.description = <<-DESC

AdaptyPlugin.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AdaptyPlugin'
3-
s.version = '3.15.7'
3+
s.version = '3.17.0'
44
s.summary = 'Common files for cross-platform SDKs Adapty'
55

66
s.description = <<-DESC

AdaptyUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AdaptyUI'
3-
s.version = '3.15.7'
3+
s.version = '3.17.0'
44
s.summary = 'Adapty SDK for iOS.'
55

66
s.description = <<-DESC

AdaptyUIBuilder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'AdaptyUIBuilder'
3-
s.version = '3.15.7'
3+
s.version = '3.17.0'
44
s.summary = 'Adapty UI Builder for iOS.'
55

66
s.description = <<-DESC

Sources.AdaptyPlugin/Codable.AdaptyUI/AdaptyUI.Action+Encodable.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extension AdaptyUI.Action: Encodable {
1313
private enum CodingKeys: String, CodingKey {
1414
case type
1515
case value
16+
case openIn = "open_in"
1617
}
1718

1819
public func encode(to encoder: Encoder) throws {
@@ -21,9 +22,10 @@ extension AdaptyUI.Action: Encodable {
2122
switch self {
2223
case .close:
2324
try container.encode("close", forKey: .type)
24-
case .openURL(let url):
25+
case .openURL(let url, let openIn):
2526
try container.encode("open_url", forKey: .type)
2627
try container.encode(url.absoluteString, forKey: .value)
28+
try container.encode(openIn, forKey: .openIn)
2729
case .custom(let id):
2830
try container.encode("custom", forKey: .type)
2931
try container.encode(id, forKey: .value)

Sources.AdaptyPlugin/Codable/AdaptyWebPresentation+Codable.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Adapty
99

10-
extension AdaptyWebPresentation: Decodable {
10+
extension AdaptyWebPresentation: Codable {
1111
public init(from decoder: any Decoder) throws {
1212
let container = try decoder.singleValueContainer()
1313
let stringValue = try container.decode(String.self)
@@ -20,4 +20,14 @@ extension AdaptyWebPresentation: Decodable {
2020
self = .externalBrowser
2121
}
2222
}
23+
24+
public func encode(to encoder: any Encoder) throws {
25+
var container = encoder.singleValueContainer()
26+
switch self {
27+
case .externalBrowser:
28+
try container.encode("browser_out_app")
29+
case .inAppBrowser:
30+
try container.encode("browser_in_app")
31+
}
32+
}
2333
}

Sources.AdaptyPlugin/cross_platform.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$schema: "https://json-schema.org/draft/2020-12/schema"
2-
$id: "https://adapty.io/crossPlatform/3.15.7/schema"
2+
$id: "https://adapty.io/crossPlatform/3.17.0/schema"
33
title: "Cross Platform Format"
44

55
$requests:
@@ -1455,9 +1455,14 @@ $defs:
14551455
- required: [type]
14561456
properties:
14571457
type: { type: string, const: ["close", "system_back"] }
1458+
- required: [type, value, open_in]
1459+
properties:
1460+
type: { type: string, const: "open_url" }
1461+
value: { type: string }
1462+
open_in: { $ref: "#/$defs/AdaptyWebPresentation" }
14581463
- required: [type, value]
14591464
properties:
1460-
type: { type: string, enum: ["open_url", "custom"] }
1465+
type: { type: string, const: "custom" }
14611466
value: { type: string }
14621467

14631468
AdaptyUI.CustomTagsValues: #request

Sources.AdaptyUI/AdaptyUI+DefaultConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public extension AdaptyPaywallControllerDelegate {
2424
switch action {
2525
case .close:
2626
controller.dismiss(animated: true)
27-
case let .openURL(url):
28-
UIApplication.shared.open(url, options: [:])
27+
case let .openURL(url, openIn):
28+
url.open(in: openIn.toBuilderWebPresentation)
2929
case .custom:
3030
break
3131
}

Sources.AdaptyUI/AdaptyUI+Public.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public extension AdaptyUI {
3636
/// User pressed Close Button
3737
case close
3838
/// User pressed any button with URL
39-
case openURL(url: URL)
39+
case openURL(url: URL, in: AdaptyWebPresentation)
4040
/// User pressed any button with custom action (e.g. login)
4141
case custom(id: String)
4242
}

0 commit comments

Comments
 (0)