何时使用 Optimizely Android SDK 中的 startOptimizelyAsync() 方法

When to use startOptimizelyAsync() method from Optimizely Android SDK

Optimizely 的 Android SDK 包含方法 Optimizely.startOptimizelyAsnyc()

但是,它的唯一文档存在 here,而且非常缺乏。我在网上找不到任何其他文档或提及它。

我想使用此方法而不是快速入门中推荐的常规方法 startOptimizely,因为我希望 Web 请求异步发生而不是依赖于 2.5 秒超时。使用异步方法有任何风险或缺点吗?

此外,我对任何回调都不感兴趣。可以为回调侦听器参数传入 null 吗?

到目前为止,我正在使用此方法并传递 null 以便回调和一切 SEEMS 顺利运行。但我想确定这是否会导致任何不愉快的意外。

谢谢!

Optimizely 人员在他们的社区论坛上回答了我的问题 post:

https://community.optimizely.com/t5/Mobile-Apps/Android-when-to-use-startOptimizelyAsync/m-p/10906#M120

Null is a perfectly acceptable value for the callback, we're very careful about handling null inputs on our APIs.

The downside to using the Async start (especially without a listener) is that you may evaluate live variables or code blocks before Optimizely has started, which means that those values will be locked to to the default value, preventing the experiment from starting. I would recommend using a callback and listening for the onOptimizelyStarted() event.