Can I control timing of network access of Optimizely SDK manually?
I have a question reagarding the timing of Optimizely SDK's network access.
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?
Solved! Go to Solution.
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!