cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@chromium.org>
Subject Re: Questions about iOS Cordova plugin
Date Fri, 13 Jun 2014 14:35:18 GMT
They should work fine, but if you have a reproducible failing case, then
please file a bug with it attached and we'll see what's up. There are
definitely known freezes if you try to use remote web inspector on iOS in
these cases, but freezes without the inspector are expected to work.


On Fri, Jun 13, 2014 at 3:47 AM, Nitta, Minoru <minoru.nitta@jp.fujitsu.com>
wrote:

> Hi,
>
>
> Thank you for your reply.
>
> My guess is the timing of calling native interface is different between
> iOS and Android. On iOS, native interface is not called when cordova.exec
> returned. On Android, native interface is called.
>
> This could mean that the subsequent javascript code of calling Cordova API
> is extecuted in the state of
>   - callback function of the Cordova API has been called (Android)
>   - callback function of the Cordova API has not been called (iOS)
>
> function viewList(){
>    :
>     foo.getLength(function(slength) {
>         for(var i=0; i < slength; i++){
>             foo.getItem(function(skey) {
>                    :
>                    :
>             }, errorHandler, i);
>         }
>     }, errorHandler);
> }
>
> Suppose that foo.getLength and foo.getItem are Cordova plugin calls.
> When viewList function is called, just foo.getLength is called on iOS.
> On Android, function(slength) is called after foo.getLenth is called.
> My understanding is correct?
>
> Minoru
> > -----Original Message-----
> > From: Marc Weiner [mailto:mhweiner234@gmail.com]
> > Sent: Friday, June 13, 2014 12:40 PM
> > To: dev
> > Subject: Re: Questions about iOS Cordova plugin
> >
> > I'm assuming you're making calls after the deviceready event, correct?
> > Otherwise, my guess is that either things haven't loaded completely when
> > you made the call, or there are scoping issues, both of which could be
> > resolved by using a setTimeout.
> >
> > Sorry if this is isn't helpful, but I figured I would try :)
> >
> > Marc
> >
> >
> > On Thu, Jun 12, 2014 at 10:58 PM, Nitta, Minoru <
> minoru.nitta@jp.fujitsu.com
> > > wrote:
> >
> > > Hi,
> > >
> > >
> > >  I have some questions about Cordova plugins for iOS.
> > >
> > >  It seems to me that Cordova APIs don't work fine if they are called
> > > within a callback function of Cordova API. This phenomenon happens on
> > > iOS but doesn't happen on Android.
> > >
> > >  Strangely, Cordova APIs work fine even if they are called within a
> > > callback function of Cordova API, if they are wrapped within a
> > > setTimeout function.
> > >
> > >  Does anybody have information about this?
> > >
> > > Thank you.
> > >
> > > Minoru
> > >
> > >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message