Skip to main content

General Concepts

Core concepts shared across Shiply SDKs on all platforms. Understanding these concepts before integrating any platform helps avoid cross-platform confusion.

Credentials and Identifiers

ConceptMeaningHow to ObtainField Names by Platform
appIdUnique application identifierShiply Web Console → Project Settings → App InformationiOS/Android appId; Harmony appId
appKeyApplication authentication keySame as aboveappKey
guid / userIdUser identifier for gray release matching by number package/rulesBusiness-defined (e.g., uin/openid)iOS guid; Android/Harmony userId
qimei / deviceIdDevice identifier for reporting and device-dimension rulesBusiness-injected (privacy compliance; SDK does not actively obtain)iOS qimei; Android/Harmony deviceId

Privacy Compliance: Privacy information such as system version, device model, and device identifiers is not actively obtained by the SDK and must be injected by the business. This is a common convention across all platforms.

Environment Identifiers

ConceptMeaningField Names by Platform
envIdEnvironment numeric IDiOS envId (default RDeliveryReleaseEnvId for production; also RDEnvironmentIotRelease = 3 for IoT release environment)
logicEnvironmentLogical environment stringHarmony logicEnvironment ("" = production, "1" = test, others = custom environment numeric ID)
environmentResource SDK environmentWindows ResHub environment (0 = Release, 1 = Test, 2 = Pre-release)

iOS configuration uses envId; Harmony uses logicEnvironment (string). Do not mix them. Resource SDK's environment and configuration's logicEnvironment are separate fields, each independent.

Update Strategies

Configuration SDK combines update strategies through bit masks; resource SDK is similar.

StrategyiOS EnumAndroid EnumDescription
Update on launchRDCONFIG_UPDATE_MODE_APP_START (1<<0)START_UPPull on app launch
Scheduled updateRDCONFIG_UPDATE_MODE_SCHEDUAL (1<<1)PERIODICPull at intervals
Update on foregroundRDCONFIG_UPDATE_MODE_ENTER_FOREGROUND (1<<2)HOT_RELOAD (foreground after background exceeds threshold)Android calls it HOT_RELOAD
Update on network recoveryRDCONFIG_UPDATE_MODE_NETWORK_CHANGE (1<<3)NETWORK_RECONNECTPull when network reconnects from offline
  • Default interval: Scheduled updates default to 4 hours (iOS updateDuration = 14400s; Android updateInterval recommended greater than 1 hour)
  • Bit mask combination: iOS updateMode = APP_START | SCHEDUAL | NETWORK_CHANGE; Android updateStrategy uses the same bit operations

systemId (Subsystem Differentiation)

systemId distinguishes different subsystems under the same app to avoid configuration data mixing:

systemIdSubsystemDescription
10001Configuration (RDelivery default)iOS/Android default value
10010Resources (ResHub)Used internally by resource SDK
10021Hotfix (Fix)Used internally by hotfix SDK
10016Harmony UpgradeHardcoded in upgrade SDK
10013TAB modeCan be set in configuration SDK

When integrating the configuration SDK, you typically do not need to explicitly set systemId (default 10001 is used). When integrating resource/upgrade SDKs, systemId is handled internally by the SDK.

Pull Target (PullTarget / target)

The C++ configuration layer (RDeliveryConfig.target) and resource layer (ResHubAppInfo.target) share the same concept, determining pull scope:

Enum ValueC++ RDPullTargetMeaning
Project level (0)RDPullTargetProjectPull only configurations/resources under the current project (default)
App level (1)RDPullTargetAppPull configurations/resources at the entire app dimension
All (2)RDPullTargetBothPull both project-level and app-level
  • iOS corresponds to RDConfigServerPullTarget (Project/App/AppAndProject)
  • Resource SDK's ResHubTarget is isomorphic to this, mapped by reshub_rdelivery_creater
  • Most scenarios use the default Project; switch to App/Both when cross-project shared configuration is needed

Dependency Injection Pattern

All platform SDKs support key component dependency injection and provide default implementations. This is a core design of Shiply SDK:

ComponentPurposeDefault Implementation
NetworkHTTP requestsiOS RDNetworkImpl (NSURLSession); Android HttpsURLConnectionNetwork; C++ INetwork
StorageKV cacheiOS RDMMKVFactoryImpl (MMKV); Android MmkvStorageFactory; C++ RAFTKVStorageProtocol
LoggingSDK log outputiOS RDLoggerImpl (NSLog); Android SystemLog; C++ ILog
JSONModel conversioniOS RDeliveryJsonModelImpl (YYModel)
RSA/AESEncryption/decryptionC++ IRSA/IAES (default implementations injected by platform)

The C++ layer provides IRSA / IAES interfaces for encryption/decryption injection; each platform injects corresponding implementations during initialization.

Strongly recommend injecting a business logging implementation: Default logging implementations (NSLog/SystemLog) are not suitable for production. Inject your business logging component to output SDK logs to your business logging system for production troubleshooting. This is a common best practice across all platforms.

When custom injection is needed:

  • Your integration uses modified MMKV/YYModel causing dependency conflicts
  • You need a custom network layer (e.g., routing through a unified business network channel or adding proxies)
  • MMKV is already initialized globally and you don't want the SDK to initialize it again

Resource Loading Strategies (Resource SDK Common)

ResHub has three resource loading semantics, consistent across platforms:

SemanticsMethod PrefixBehavior
Locked Version (Lock)resWithId / loadWithIdReturns the same version across multiple calls within a process; suitable for scenarios requiring consistent experience
Latest Version (Latest)latestResWithId / loadLatestWithIdReturns the latest resource in local configuration; multiple calls may return different versions
Realtime LatestloadRealtimeLatestWithIdForces a real-time configuration request before fetching the latest package; high cost for frequent calls; use only for resources with extremely high real-time requirements
  • res/get series: Synchronous local read, no network request
  • load series: Asynchronous, may trigger network pull
  • loadLatest returns the "latest in local configuration", which may lag behind the platform latest; use loadRealtimeLatest for real-time latest

Custom Attributes (custom_properties)

custom_properties is a key parameter for RequestFullRemoteData calls, used to match gray release rules by custom attributes:

  • The business passes custom_properties (key-value pairs) when pulling full data; the server matches corresponding gray release rules based on attribute values and delivers different configurations/resources
  • Typical attributes: user level (vip_level), region, A/B experiment group, etc.
  • Not passing is equivalent to not participating in custom attribute matching; only default dimensions (userId/deviceId, etc.) are matched
  • Platform implementations: iOS RDeliverySDKSettings.customProperties; Android RDeliverySetting.customProperties; Harmony custom_properties

Configuration Default Values

When reading configurations, if the remote end does not have the key / has not been pulled / web console has not set a value, defaultValue is returned:

  • With defaultValue parameter: Returns defaultValue
  • Without: Returns corresponding empty value (object nil, int 0, etc.)
Was this page helpful?