Skip to content

Commit e35f612

Browse files
authored
Merge pull request #283 from qonversion/kamo/dev-434-custom-localization
2 parents 3702f03 + aeacdbc commit e35f612

6 files changed

Lines changed: 32 additions & 18 deletions

File tree

QonversionSandwich.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Pod::Spec.new do |s|
1313
s.framework = 'StoreKit'
1414
s.platforms = {
1515
"ios" => "13.0",
16-
"osx" => "10.13"
16+
"osx" => "10.15"
1717
}
1818
s.source_files = 'ios/sandwich/**/*.{h,m,swift}'
19-
s.dependency "Qonversion", "6.1.0"
19+
s.dependency "Qonversion", "6.3.0"
2020
s.module_name = 'QonversionSandwich'
2121
end

android/sandwich/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.nocodes_version = '1.2.1'
2+
ext.nocodes_version = '1.3.0'
33
}
44

55
plugins {

android/sandwich/src/main/kotlin/io/qonversion/sandwich/NoCodesSandwich.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class NoCodesSandwich {
3939
projectKey: String,
4040
proxyUrl: String? = null,
4141
logLevelKey: String? = null,
42-
logTag: String? = null
42+
logTag: String? = null,
43+
locale: String? = null
4344
) {
4445
val configBuilder = NoCodesConfig.Builder(context, projectKey)
4546

@@ -60,6 +61,10 @@ class NoCodesSandwich {
6061
configBuilder.setLogTag(it)
6162
}
6263

64+
locale?.takeIf { it.isNotEmpty() }?.let {
65+
configBuilder.setLocale(it)
66+
}
67+
6368
NoCodes.initialize(configBuilder.build())
6469
}
6570

@@ -132,6 +137,10 @@ class NoCodesSandwich {
132137
NoCodes.shared.setLogTag(logTag)
133138
}
134139

140+
fun setLocale(locale: String?) {
141+
NoCodes.shared.setLocale(locale)
142+
}
143+
135144
// endregion
136145

137146
// region Purchase Management

ios/Podfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ source 'https://github.com/CocoaPods/Specs.git'
44
platform :ios, '13.0'
55

66
use_frameworks!
7-
#
8-
# target 'QonversionSandwich' do
9-
# pod 'NoCodes', '0.1.3'
10-
# end
117

128
target 'Sample' do
139
pod 'QonversionSandwich', :path => '../'

ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- Qonversion (6.1.0):
3-
- Qonversion/Main (= 6.1.0)
4-
- Qonversion/Main (6.1.0)
5-
- QonversionSandwich (7.1.0):
6-
- Qonversion (= 6.1.0)
2+
- Qonversion (6.3.0):
3+
- Qonversion/Main (= 6.3.0)
4+
- Qonversion/Main (6.3.0)
5+
- QonversionSandwich (7.2.0):
6+
- Qonversion (= 6.3.0)
77

88
DEPENDENCIES:
99
- QonversionSandwich (from `../`)
@@ -17,9 +17,9 @@ EXTERNAL SOURCES:
1717
:path: "../"
1818

1919
SPEC CHECKSUMS:
20-
Qonversion: 0b64e731cb59f94ab03c132cea2b70552b4dcc2b
21-
QonversionSandwich: 1b9f83ed758c0a9289e09981b82c6e9fc65e7fa4
20+
Qonversion: 8f8fb604e2b9fb442eeb6a7aefcbc6bd73c3b55a
21+
QonversionSandwich: f0fcb1ca6cda6162ab49ef13135ef5accc4d826e
2222

23-
PODFILE CHECKSUM: e5fb0f1b622edd873d42d0bef64736d62943be41
23+
PODFILE CHECKSUM: ac49d3b542908b3399ace18f7369621020b752c0
2424

2525
COCOAPODS: 1.16.2

ios/sandwich/NoCodesSandwich.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ public class NoCodesSandwich: NSObject {
2626

2727
@objc public func initialize(
2828
projectKey: String,
29-
proxyUrl: String? = nil
29+
proxyUrl: String? = nil,
30+
locale: String? = nil
3031
) {
31-
let noCodesConfig = NoCodesConfiguration(projectKey: projectKey, proxyURL: proxyUrl?.isEmpty == true ? nil : proxyUrl)
32+
let noCodesConfig = NoCodesConfiguration(
33+
projectKey: projectKey,
34+
proxyURL: proxyUrl?.isEmpty == true ? nil : proxyUrl,
35+
locale: locale?.isEmpty == true ? nil : locale
36+
)
3237

3338
NoCodes.initialize(with: noCodesConfig)
3439
NoCodes.shared.set(delegate: self)
@@ -62,6 +67,10 @@ public class NoCodesSandwich: NSObject {
6267
NoCodes.shared.close()
6368
}
6469

70+
@objc public func setLocale(_ locale: String?) {
71+
NoCodes.shared.setLocale(locale)
72+
}
73+
6574
@objc public func getAvailableEvents() -> [String] {
6675
let availableEvents: [NoCodesEvent] = [
6776
.screenShown,

0 commit comments

Comments
 (0)