optimizely/android-sdk

OptimizelyManager Builder requires projectId or sdkKey

Closed this issue · 0 comments

Right now the OptimizelyManager.Builder requires either a projectId or a sdkKey. If neither are provided, build() will return null. One of these are required so that if a DatafileConfig is not provided, one can be created. However, if a DatafileConfig is provided, then neither projectId or sdkKey should be necessary.
For instance, if one was to create an OptimizelyManager as such, then sdkKey or projectId should not be required.

val sdkKey = "myKey"
val datafileConfig = DatafileConfig(null, sdkKey, OPTIMIZELY_DATAFILE_HOST)
val optimizelyManager = OptimizelyManager.builder()
  .withDatafileConfig(datafileConfig)
  .withSDKKey(sdkKey) // not needed since we provide a DatafileConfig, but if not provided, build() returns null
  .build(context)