requestDeferredDeeplinkParameters static method

Future<Map<String, String>> requestDeferredDeeplinkParameters()

Requests deferred deeplink parameters.

Relevant only for Android. For iOS, it returns the unknown error.

Implementation

static Future<Map<String, String>> requestDeferredDeeplinkParameters() =>
    _appMetrica.requestDeferredDeeplinkParameters().then((value) {
      final error = value.error;
      if (error != null &&
          error.reason != AppMetricaDeferredDeeplinkReasonPigeon.NO_ERROR) {
        throw AppMetricaDeferredDeeplinkRequestException(
            _deferredDeeplinkErrorToDart(error.reason),
            error.description,
            error.message);
      } else if (value.parameters == null) {
        throw AppMetricaDeferredDeeplinkRequestException(
            AppMetricaDeferredDeeplinkErrorReason.unknown,
            "Unable to retrieve deeplink from native library",
            error?.message);
      } else {
        return value.parameters!
            .map((key, value) => MapEntry(key as String, value as String));
      }
    });