6 ms·
Having spent a fair amount of time in PhoneGap, I recall one of the tricky bits of using stringByEvaluatingJavaScriptFromString to call into JS land was that it
by ggoodale 13y ago
Having spent a fair amount of time in PhoneGap, I recall one of the tricky bits of using stringByEvaluatingJavaScriptFromString to call into JS land was that it could block, leading Apple to impose a 5 second timeout on that particular API call. Is that still the case? I recall that making loading large objects created/fetched via native code more complicated.
Congratulations on 2.0, regardless!
- restelettedo 13y agostringByEvaluatingJavaScriptFromString calls are still capped, at 10MB and 10 seconds - that might be up from the 5 seconds you experienced. Our approach to that is two-fold: We try not to send big chunks of data through the bridge (we pass file around by reference, for example): in our initial prototypes a couple of years ago we passed image data base64 encoded and that definitely didn't scale! Secondly, stringByEvaluatingJavaScriptFromString just gets data into the JS engine's scope - the processing of those received messages is done in a separate thread of execution. By that I mean started by an event, not true multi-threading of course!
- ggoodale 13y agoThanks for clarifying! Makes sense.