.NET MAUI SDK best practice
Mobile application performance is critical to your business. Our technology is focused on improving your customer's experience with your app. As such, screen performance is a core component of our solutions. To boost engagement and conversion rates, we employ several approaches to minimize screen load times.
Using App Configurations
Applications can now send configuration settings from their own application environment. This allows Rokt SDK to use application custom configurations instead of relying solely on system defaults.
ColorMode object
Value | Description |
---|---|
Light | Application is in Light Mode |
Dark | Application is in Dark Mode |
System | Application defaults to System Color Mode |
// If your application supports only Light Mode
var roktConfig = new RoktConfig() { ColorMode = ColorMode.Light };
Rokt.Maui.Sdk.Rokt.Execute(
// other params,
config: roktConfig,
);
CacheConfig object
Parameter | Description |
---|---|
cacheDurationInSeconds | Optional duration in seconds for which the Rokt SDK should cache the experience. Maximum allowed value is 90 minutes and the default (if value is not provided or invalid) is 90 minutes. |
cacheAttributes | Optional attributes to be used as cache key. If null, all the attributes sent in Rokt.Execute will be used as the cache key. |
// to cache the experience for 1200 seconds, using email and orderNumber attributes as the cache key.
var cacheConfig = new CacheConfig
{
CacheDurationInSeconds = 1200,
CacheAttributes = new Dictionary<string, string>() {
{"email", "j.smith@example.com"},
{"orderNumber", "123"}
}
};
var roktConfig = new RoktConfig() { CacheConfig = cacheConfig };
Rokt.Maui.Sdk.Rokt.Execute(
// other params,
config: roktConfig,
);
For more information see how-to section.