floatinghotpot / cordova-mobfox-pro

Enhanced MobFox plugin for Cordova/PhoneGap. Banner, Interstitial and Video Ad. Support many other Ad network with server-side integration.
8 stars 3 forks source link

iOS complains plugin should use background thread. #4

Closed jgberg closed 9 years ago

jgberg commented 9 years ago

I think the plugin runs on the main UI thread. This means that when it runs it has impact on the responsiveness of UI because it blocks the UI while it does it's work. This appears in the console under iOS:

2014-10-21 09:29:26.078 AppName[17594:370316] prepareInterstitial
2014-10-21 09:29:26.222 AppName[17594:370316] THREAD WARNING: ['MobFox'] took '162.559814' ms. Plugin should use a background thread.

This delay is on a very fast network, and I have not yet tested this under true mobile condition where it could be unacceptable, especially for video ads.

floatinghotpot commented 9 years ago

the delay is for creating local ui, not for loading ad from remote server, so no much impact.

no problem, i will optimize it.

floatinghotpot commented 9 years ago

it's optimized in previous a few commits.

jgberg commented 9 years ago

This is still occurring... It adds sometimes up to 300msec to load time, which isn't great. It's not a critical problem, but it does not help user experience. At times it's is 60msec which isn't a problem. So I would not call this item closed for the sake of identifying and tracking issues, but it's not urgent to deal with either.

floatinghotpot commented 9 years ago

any log? need see which method need be optimized.

it takes some time to do its job, put it in background thread should be fine, as it will not block ui.