Skip to content

Optimizely initialization without downloading Datafile #300

Closed
@AndreBaltazar8

Description

@AndreBaltazar8

Hello,

We are using this Android SDK on a Kotlin application to control experiments and features for thousands of devices which have bandwidth restrictions. We want to control when the datafile updated, so we are not using polling to prevent wasting bandwidth. The issue here is that this SDK will download the datafile every time the client is initialized.

The methods provided do not allow initializing the manager without downloading cache file. The following method,

protected OptimizelyClient initialize(@NonNull Context context, @Nullable String datafile, boolean downloadToCache) {

is prepared to receive a flag to decide if it should download or not, but there is no path where this is called with the value false. We think this method should have been public, instead of protected.

There are two alternatives to this, which are:

  • Creating a custom DatafileHandler, which will block certain request, but since using your methods to download the cache files, this would be tricky requiring changing some flags or something to know if we are initializing and blocking those, which feels like too much on an hack
  • Call that initialization method with reflection, which is not really ideal, but is the solution we are using right now

Is there any alternative? What is the recommended approach for this? Would it be possible to make that method public?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions