-
Notifications
You must be signed in to change notification settings - Fork 2
3. Configuration of dev, test and prod environments
Trustylib calls TrustedShops backend API for loading details like trust certificate validity, grade/rating, buyer protection, etc.
TrustedShops backend API has three environments development
, stage
and production
and Trustylib can be configured to connect to one of these environments for loading your shop and product grade/rating details.
Trustylib looks for a TrustbadgeEnvironment
property in your iOS app's info.plist
file. If this property is found, Trustylib environment is set accordingly. Else, library's environment is set to production
as default environment.
To provide a valid value to the TrustbadgeEnvironment
property, you need to add a user defined property (with possible values as development
, stage
and production
) under your xcode project's target build settings. This is how it is done,
TrustbadgeEnvironmentManager
is a singleton class that helps configure Trustylib environment to one of the environments (development, stage and production) defined in TrustbadgeEnvironment
enumeraton. Instance of this environment manager can be accessed via TrustbadgeEnvironmentManager.shared
static property.
TrustbadgeEnvironmentManager has a private constructor method which attempts to fetch value of TrustbadgeEnvironment
property from the host iOS app's info.plist
. If this property is found with one of the supported values, Trustylib's current environment is set accordingly. Else, it sets the current environment to production
as default environment.