ULinkConfig.fromJson constructor

ULinkConfig.fromJson(
  1. Map<String, dynamic> json
)

Creates a configuration from JSON

Implementation

factory ULinkConfig.fromJson(Map<String, dynamic> json) {
  return ULinkConfig(
    apiKey: json['apiKey'],
    baseUrl: json['baseUrl'] ?? 'https://api.ulink.ly',
    debug: json['debug'] ?? false,
    persistLastLinkData: json['persistLastLinkData'] ?? false,
    lastLinkTimeToLive: json['lastLinkTimeToLive'] != null
        ? Duration(milliseconds: json['lastLinkTimeToLive'])
        : null,
    clearLastLinkOnRead: json['clearLastLinkOnRead'] ?? true,
    redactAllParametersInLastLink:
        json['redactAllParametersInLastLink'] ?? false,
    redactedParameterKeysInLastLink:
        List<String>.from(json['redactedParameterKeysInLastLink'] ?? []),
    enableDeepLinkIntegration: json['enableDeepLinkIntegration'] ?? true,
    enableAutomaticAppDelegateIntegration:
        json['enableAutomaticAppDelegateIntegration'] ?? true,
    enableAnalytics: json['enableAnalytics'] ?? true,
    enableCrashReporting: json['enableCrashReporting'] ?? false,
    timeout: json['timeout'] ?? 30000,
    retryCount: json['retryCount'] ?? 3,
    metadata: json['metadata'] != null
        ? Map<String, dynamic>.from(json['metadata'])
        : null,
    autoCheckDeferredLink: json['autoCheckDeferredLink'] ?? true,
  );
}