Rich-text Reply

Can I control timing of network access of Optimizely SDK manually?

Tammy 01-29-16
Accepted Solution

Can I control timing of network access of Optimizely SDK manually?

Hello,

 

I have a question reagarding the timing of Optimizely SDK's network access.

 

https://help.optimizely.com/hc/en-us/articles/205014107-How-Optimizely-s-SDKs-Work-SDK-Order-of-exec...

 

According to the post above, Optimizely SDK start to access internet for downloading JSON automatically.

Is it possible to have Optimizely SDK wait to access internet until something like trigger I set in the code fires?

 

I could learn I can control the timing to have Optimizely test run by http://developers.optimizely.com/ios/help/html/Classes/Optimizely.html#//api/name/activateManualExpe... but the thing I would like to know is the timing of Optimizely SDK start to make internet acess.

 

Could you please advise me?

 

Thank you,

Tammy

 

Tamie
Level 6

Pam 01-29-16
 

Re: Can I control timing of network access of Optimizely SDK manually?

Hi @Tammy,

Great question! I'd love to learn more about your use case for wanting to wait for the Optimizely to access the internet. Is there a reason you would like Optimizely not to access the internet at startup?

There's two things that I think might help you.
- We have the option of allowing you to enable Optimizely asynchronously (where the datafile download will happen in the background on start): http://developers.optimizely.com/ios/reference/index.html#custom-initialization
- We also allow you to control how often network calls are made to Optimizely after Optimizely has started. You can adjust how often network calls are made here: http://developers.optimizely.com/ios/reference/index.html#network-settings

You could also theoretically call startOptimizelyWithAPIToken later in your app (which will delay internet access), but three things to note:
- In your code you will want to guarantee that live variables or code blocks are not accessed prior to startOptimizelyWithAPIToken, otherwise experiments will not run.
- If Optimizely is started later in the app, the visual editor may not work as expected.
- This is not a typical implementation of Optimizely and many use cases may not work as expected.

Please let me know if you have additional questions on this!

Best,
Pam
Pam
Optimizely
Tammy 02-01-16
 

Re: Can I control timing of network access of Optimizely SDK manually?

Thank you @Pam!
I could learn a lot from you, I appreciate you very much!

Best regards,
Tammy
Tamie
Level 6