Skip to content

Commit

Permalink
Merge pull request #112 from nstack-io/fix/debug_mode
Browse files Browse the repository at this point in the history
fix: Localization updating -  dev query parameter dynamic setting
  • Loading branch information
mariusc authored Apr 19, 2024
2 parents 01dbf4a + abd3017 commit ec49080
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NStackSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'NStackSDK'
s.version = '5.1.3'
s.version = '5.2.1'
s.summary = 'NStackSDK is the companion software development kit to the NStack backend.'

# This description is used to generate tags and improve search results.
Expand Down
14 changes: 12 additions & 2 deletions NStackSDK/Classes/NStack Manager/ConnectionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,22 @@ extension ConnectionManager {
}
// MARK: - LocalizationRepository
extension ConnectionManager {
func getLocalizationDescriptors<D>(acceptLanguage: String, lastUpdated: Date?, completion: @escaping (NStackSDK.Result<[D]>) -> Void) where D: LocalizationDescriptor {

func getLocalizationDescriptors<D>(acceptLanguage: String,
lastUpdated: Date?,
completion: @escaping (NStackSDK.Result<[D]>) -> Void) where D: LocalizationDescriptor {
var devMode = false
#if DEBUG
devMode = true
#endif

let params: [String: Any] = [
"guid": Configuration.guid,
"platform": "ios",
"last_updated": VersionUtilities.lastUpdatedIso8601DateString,
"dev": "true"
// NStack has a Publish feature for localizations - localization changes need to be published in order to be visible in production
// Setting the "dev" flag to "true" fetches the localizations changes even if they are not published
"dev": devMode ? "true" : "false"
]

var headers = defaultHeaders
Expand Down

0 comments on commit ec49080

Please sign in to comment.