RU EN
flutter_rustore_remoteconfig
Flutter RuStore SDK for working with RuStore remote config.
Preparing Required Parameters
To run the example, you need the following parameters:
app_id- your AppId from the Remote Config console (https://remote-config.rustore.ru).- Create config parameters in the console.
Setting Up the Example Application
- Replace the value of the variable
app_idin the file flutter_rustore_remoteconfig/example/lib/main.dart with yourapp_idfrom the console. - Replace the value of the variable
String? config = ""with your parameter from the console.
Implementation Example
To learn how to properly integrate remote-config, it is recommended to review the example application
Adding to Project
To add the package to your project, execute the command
flutter pub add flutter_rustore_remoteconfig
This command will add a line to the pubspec.yaml file
dependencies:
flutter_rustore_remoteconfig: ^10.5.1
iOS: requires Flutter 3.44+ (Swift Package Manager is used by default). CocoaPods is no longer supported.
Configuring ATS on iOS (Recommended)
Starting from native SDK version 1.2.0, the SDK uses the client-api-m.remote-config.rustore.ru domain, whose server is served by a TLS certificate from the Russian Certificate Authority (MinTsifry). iOS only trusts chains from the Apple system store by default and rejects connections to such a server — even when certificate validation is performed by the SDK.
If your app needs to reach this domain, add an ATS exception to the app's Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>client-api-m.remote-config.rustore.ru</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
Certificate validation is fully preserved and performed inside the SDK: built-in MinTsifry anchors in addition to system roots, plus hostname, expiry and signature checks.
Without this exception, the SDK keeps working through the fallback domain client-api.remote-config.rustore.ru (publicly trusted certificate), but requests will stop succeeding once the public certificates are revoked.
Creating a Client
To work with the configuration, we need to create a RemoteConfigClient using the method
FlutterRustoreRemoteconfig.create(
String appId,
PluginUpdateBehavior updateBehavior,
int interval, StaticParameters parameters,
{Function? onBackgroundJobErrors,
Function? onFirstLoadComplete,
Function? onMemoryCacheUpdated,
Function? onInitComplete,
Function? onPersistentStorageUpdated,
Function? onRemoteConfigNetworkRequestFailure}
)`.
FlutterRustoreRemoteconfig.create(
appId,
behavior,
interval,
Parameters(),
onBackgroundJobErrors: (value) {
},
onFirstLoadComplete: () {
},
onMemoryCacheUpdated: () {
},
onInitComplete: () {
},
onPersistentStorageUpdated: () {
},
onRemoteConfigNetworkRequestFailure: (value) {
});
appId - Application id of your project Remote config;
behavior - SDK update policy;
interval - Time for changing the snapshot update policy;
parameters - Static SDK parameters;
Function? onBackgroundJobErrors,
Function? onFirstLoadComplete,
Function? onMemoryCacheUpdated,
Function? onInitComplete,
Function? onPersistentStorageUpdated,
Function? onRemoteConfigNetworkRequestFailure``` - SDK event listeners;
Creating a Client with Configuration Retrieval
If you need to make a request to remoteConfig at app startup, you can use the createAndGetRemoteConfig method to avoid sequentially calling create and getRemoteConfig
FlutterRustoreRemoteconfig.createAndGetRemoteConfig(
appId,
behavior,
interval,
Parameters(),
onBackgroundJobErrors: (value) {
},
onFirstLoadComplete: (value) {
},
onMemoryCacheUpdated: (value) {
},
onInitComplete: (value) {
},
onPersistentStorageUpdated: (value) {
},
onRemoteConfigNetworkRequestFailure: (value) {
});
Retrieving Remote Config Configuration
FlutterRustoreRemoteconfig.getRemoteConfig().then(((value) {
}), onError: (err) {
debugPrint("err: $err");
});
The getRemoteConfig method returns an instance of RemoteConfig — this is the current set of all data received depending on the selected update policy during initialization. The instance has all the keys that were sent by the server based on the parameters specified during initialization.
The FlutterRustoreRemoteconfig class has methods for retrieving data and converting it to specific types.
containsKey(String key);
getString(String key);
getBool(String key);
getInt(String key);
getDoube(String key);
getShortSegments();
key - Parameter created in the Remote config console.