meg4cyberc4t / varioqub_configs

Flutter plugin providing work with remote configs, experiments and A/B testing via Varioqub
https://pub.dev/packages/varioqub_configs
MIT License
2 stars 0 forks source link

There are no conversion statistics in App metrics A/B test #17

Closed HiddenZz closed 6 months ago

HiddenZz commented 6 months ago

Events added to AppMetrica are not counted in the A/B-test. As a result of A/B test my statistics are empty.

Initialization

  final configs = VarioqubConfigs();
      await configs.build(
       BuildSettings(client: VarioqubClient.appmetrica(projectId)),
      );
    configs
        .fetchConfig()
        .onError<PlatformException>((e, s) => l.error(e, stackTrace: s))
        .then((_) => configs.activateConfig())
        .ignore();

    await configs.activateConfig();

But I can get the flags and keys of the A/B test

  final id = await configs.getId();
    final value = await configs.getString(
      key: 'key',
      defaultValue: 'DEFAULT_VALUE',
    );

Packages version

varioqub_configs: ^0.6.2
appmetrica_plugin: ^1.4.0
meg4cyberc4t commented 6 months ago

Hi. Thank you for your issue. I really appreciate every voluntary contribution to the library.

That's the problem: https://github.com/meg4cyberc4t/varioqub_configs/blob/main/android/src/main/kotlin/com/meg4cyberc4t/varioqub_configs/VarioqubReceiverAdapter.kt

https://github.com/meg4cyberc4t/varioqub_configs/blob/f47dbfe7d65bf8355b152b83548bca56f12c7387/ios/Classes/VarioqubConfigsPlugin.swift#L51-L52

Adapters are not adapted for metrics and reporting. There is no adapter at all in the ios version. This problem can be solved if we use adapter implementations from native packages AppmetricaAdapter for ios (Varioqub/MetricaAdapter) and AppMetricaAdapter for android (com.yandex.varioqub.appmetricaadapter.AppMetricaAdapter).

However, the following problem is created when building iOS versions. Varioqub/MetricaAdapter and appmetrica_plugin use a static implementation of YandexMobileMetrica under the hood, which makes it impossible to build a project with varioqub_configs and appmetrica_plugin.

Installing Flutter (1.0.0)
Installing Varioqub (0.6.0)
Installing YandexMobileMetrica (4.5.2)
Installing appmetrica_plugin (1.4.0)
Installing varioqub_configs (0.6.1)
[!] The 'Pods-Runner' target has frameworks with conflicting names: yandexmobilemetrica.xcframework.

I have already informed the Appmetrica developers about this problem, asking them to use a dynamic version of the framework in any of the libraries, which will make it possible for us to use the new version. I received an answer - you need to wait for the next version of the library with a fix:

Снимок экрана 2024-03-22 в 14 58 40

(Connecting Varioqub without explicit dependency is impossible in our case, each plugin is built separately from the main application and the build crashes)

Unfortunately, I can't do anything more until the new version is released.

You can see my work in this branch: https://github.com/meg4cyberc4t/varioqub_configs/pull/18/files

And also write to the developers of AppMetrica with a link to this issue, perhaps this is how we motivate them to release a new version faster..

You can try to run your hands into the appmetrica_plugin Podfile and replace the YandexMobileMetrica dependency with YandexMobileMetrica/Dynamic. However, this is not a support or even a solution, if you change the version, everything will be broken.

meg4cyberc4t commented 6 months ago

The appmetrica_plugin has been updated to v2.0.0. I am currently updating

meg4cyberc4t commented 6 months ago

Its solved.

If you have this bug again, be sure to check that you use the following versions.

appmetrica_plugin: ^2.0.0 # or higher
varioqub_configs: ^0.7.0 # or higher
HiddenZz commented 4 months ago

@meg4cyberc4t Hi, I have updated all the necessary dependencies and it worked for Android devices. Thank you! However, iOS still does not collect the statistics.