Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2025-07-18 16:10:43 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9e2e04422d98b01a8b36c22d182c9757bcee5d60
9e2e0442
1 parent
d8fdd587
replace baseUrl and host with the deh equivalents
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
28 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Core/WarplySDK.swift
SwiftWarplyFramework/SwiftWarplyFramework/Network/NetworkService.swift
SwiftWarplyFramework/SwiftWarplyFramework/Core/WarplySDK.swift
View file @
9e2e044
...
...
@@ -168,15 +168,15 @@ public struct Configuration {
var
baseURL
:
String
{
switch
self
{
case
.
development
:
return
"https://engage-
stage.warp.ly
"
case
.
production
:
return
"https://engage
.warp.ly
"
case
.
development
:
return
"https://engage-
uat.dei.gr
"
case
.
production
:
return
"https://engage
-prod.dei.gr
"
}
}
var
host
:
String
{
switch
self
{
case
.
development
:
return
"engage-
stage.warp.ly
"
case
.
production
:
return
"engage
.warp.ly
"
case
.
development
:
return
"engage-
uat.dei.gr
"
case
.
production
:
return
"engage
-prod.dei.gr
"
}
}
}
...
...
@@ -275,7 +275,7 @@ public final class WarplySDK {
* @param language The default language code for localized content (defaults to "el")
*
* @discussion This method configures:
* - Base URL based on environment (development: engage-
stage.warp.ly, production: engage.warp.ly
)
* - Base URL based on environment (development: engage-
uat.dei.gr, production: engage-prod.dei.gr
)
* - Internal storage for appUuid and merchantId
* - Default language for API requests
*
...
...
@@ -286,16 +286,16 @@ public final class WarplySDK {
* ```swift
* // Development environment
* WarplySDK.shared.configure(
* appUuid: "
f83dfde1145e4c2da69793abb2f579af
",
* merchantId: "
20113
",
* appUuid: "
d5f9038f46374666a1f4e1039d89f608
",
* merchantId: "",
* environment: .development,
* language: "el"
* )
*
* // Production environment
* WarplySDK.shared.configure(
* appUuid: "
0086a2088301440792091b9f814c2267
",
* merchantId: "
58763
",
* appUuid: "
d5f9038f46374666a1f4e1039d89f608
",
* merchantId: "",
* environment: .production,
* language: "el"
* )
...
...
@@ -318,16 +318,6 @@ public final class WarplySDK {
print
(
"✅ [WarplySDK] Environment configured:
\(
storage
.
environment
)
"
)
}
/// Set environment (development/production)
public
func
setEnvironment
(
_
isDev
:
Bool
)
{
if
isDev
{
storage
.
appUuid
=
"f83dfde1145e4c2da69793abb2f579af"
storage
.
merchantId
=
"20113"
}
else
{
storage
.
appUuid
=
"0086a2088301440792091b9f814c2267"
storage
.
merchantId
=
"58763"
}
}
/**
* Initialize the SDK and perform automatic device registration
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Network/NetworkService.swift
View file @
9e2e044
...
...
@@ -70,7 +70,7 @@ public final class NetworkService: NetworkServiceProtocol {
private
let
session
:
URLSession
private
var
baseURL
:
String
{
// Dynamic baseURL that always reads from Configuration
return
Configuration
.
baseURL
.
isEmpty
?
"https://engage-
stage.warp.ly
"
:
Configuration
.
baseURL
return
Configuration
.
baseURL
.
isEmpty
?
"https://engage-
uat.dei.gr
"
:
Configuration
.
baseURL
}
private
let
networkMonitor
:
NWPathMonitor
private
let
monitorQueue
=
DispatchQueue
(
label
:
"NetworkMonitor"
)
...
...
@@ -570,15 +570,12 @@ public final class NetworkService: NetworkServiceProtocol {
/// Get environment string for map data endpoints
private
func
getEnvironment
()
->
String
{
// Determine environment based on app UUID or configuration
let
appUuid
=
getAppUUID
()
// Development environment UUID
if
appUuid
==
"f83dfde1145e4c2da69793abb2f579af"
{
return
"dev"
}
else
{
return
"prod"
// Use stored environment from WarplySDK
if
let
storedEnvironment
=
UserDefaults
.
standard
.
string
(
forKey
:
"environmentUD"
)
{
return
storedEnvironment
==
"development"
?
"dev"
:
"prod"
}
// Fallback to production
return
"prod"
}
...
...
Please
register
or
login
to post a comment