You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Becky Gibson <gi...@gmail.com> on 2012/10/02 21:17:29 UTC

Plugin api's being called multiple times in iOS

I just updated my cordova-ios, cordova-js and cordova-mobile-spec sources.
 Created a new project and ran the sample app.   All was fine.  Made my
changes, incorporated the mobile-spec files and started testing.  Silly me
not to run the mobile-spec against a clean build first.

It seems that in the current code, plugin apis are being called multiple
(as in 3-6) in the objective-c code for each JavaScript call.   Help
debugging would be appreciated.

-b

Re: Plugin api's being called multiple times in iOS

Posted by Andrew Grieve <ag...@chromium.org>.
Should be fixed now. I'm going to spend a bit more time in trying to
optimize the bridge, but AFIAK, it should be bug free now.


On Tue, Oct 2, 2012 at 4:31 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Created a bug for this:
> https://issues.apache.org/jira/browse/CB-1576
>
> I won't get to it until tomorrow though.
>
>
> On Tue, Oct 2, 2012 at 4:04 PM, Andrew Grieve <ag...@chromium.org>wrote:
>
>> I'm hitting this as well (even before seeing your email!). It looks like
>> my recent change to return YES in canInitWithRequest: cause it to be called
>> multiple times. I think the best thing to is to switch the default mode to
>> XHR_NO_PAYLOAD. I've just done this in incubator-cordova-js, and am still
>> working on tweaking things in the iOS side.
>>
>>
>> On Tue, Oct 2, 2012 at 3:31 PM, Becky Gibson <gi...@gmail.com>wrote:
>>
>>> OK, it definitely has to do with the bridgeMode. Forcing
>>>
>>> bridgeMode = jsToNativeModes.IFRAME_NAV
>>>
>>> gets me out of debugging hell in iOS 6.
>>>
>>> -becky
>>>
>>> On Tue, Oct 2, 2012 at 3:17 PM, Becky Gibson <gi...@gmail.com>
>>> wrote:
>>>
>>> > I just updated my cordova-ios, cordova-js and cordova-mobile-spec
>>> sources.
>>> >  Created a new project and ran the sample app.   All was fine.  Made my
>>> > changes, incorporated the mobile-spec files and started testing.
>>>  Silly me
>>> > not to run the mobile-spec against a clean build first.
>>> >
>>> > It seems that in the current code, plugin apis are being called
>>> multiple
>>> > (as in 3-6) in the objective-c code for each JavaScript call.   Help
>>> > debugging would be appreciated.
>>> >
>>> > -b
>>> >
>>>
>>
>>
>

Re: Plugin api's being called multiple times in iOS

Posted by Andrew Grieve <ag...@chromium.org>.
Created a bug for this:
https://issues.apache.org/jira/browse/CB-1576

I won't get to it until tomorrow though.


On Tue, Oct 2, 2012 at 4:04 PM, Andrew Grieve <ag...@chromium.org> wrote:

> I'm hitting this as well (even before seeing your email!). It looks like
> my recent change to return YES in canInitWithRequest: cause it to be called
> multiple times. I think the best thing to is to switch the default mode to
> XHR_NO_PAYLOAD. I've just done this in incubator-cordova-js, and am still
> working on tweaking things in the iOS side.
>
>
> On Tue, Oct 2, 2012 at 3:31 PM, Becky Gibson <gi...@gmail.com>wrote:
>
>> OK, it definitely has to do with the bridgeMode. Forcing
>>
>> bridgeMode = jsToNativeModes.IFRAME_NAV
>>
>> gets me out of debugging hell in iOS 6.
>>
>> -becky
>>
>> On Tue, Oct 2, 2012 at 3:17 PM, Becky Gibson <gi...@gmail.com>
>> wrote:
>>
>> > I just updated my cordova-ios, cordova-js and cordova-mobile-spec
>> sources.
>> >  Created a new project and ran the sample app.   All was fine.  Made my
>> > changes, incorporated the mobile-spec files and started testing.  Silly
>> me
>> > not to run the mobile-spec against a clean build first.
>> >
>> > It seems that in the current code, plugin apis are being called multiple
>> > (as in 3-6) in the objective-c code for each JavaScript call.   Help
>> > debugging would be appreciated.
>> >
>> > -b
>> >
>>
>
>

Re: Plugin api's being called multiple times in iOS

Posted by Andrew Grieve <ag...@chromium.org>.
I'm hitting this as well (even before seeing your email!). It looks like my
recent change to return YES in canInitWithRequest: cause it to be called
multiple times. I think the best thing to is to switch the default mode to
XHR_NO_PAYLOAD. I've just done this in incubator-cordova-js, and am still
working on tweaking things in the iOS side.


On Tue, Oct 2, 2012 at 3:31 PM, Becky Gibson <gi...@gmail.com> wrote:

> OK, it definitely has to do with the bridgeMode. Forcing
>
> bridgeMode = jsToNativeModes.IFRAME_NAV
>
> gets me out of debugging hell in iOS 6.
>
> -becky
>
> On Tue, Oct 2, 2012 at 3:17 PM, Becky Gibson <gi...@gmail.com>
> wrote:
>
> > I just updated my cordova-ios, cordova-js and cordova-mobile-spec
> sources.
> >  Created a new project and ran the sample app.   All was fine.  Made my
> > changes, incorporated the mobile-spec files and started testing.  Silly
> me
> > not to run the mobile-spec against a clean build first.
> >
> > It seems that in the current code, plugin apis are being called multiple
> > (as in 3-6) in the objective-c code for each JavaScript call.   Help
> > debugging would be appreciated.
> >
> > -b
> >
>

Re: Plugin api's being called multiple times in iOS

Posted by Becky Gibson <gi...@gmail.com>.
OK, it definitely has to do with the bridgeMode. Forcing

bridgeMode = jsToNativeModes.IFRAME_NAV

gets me out of debugging hell in iOS 6.

-becky

On Tue, Oct 2, 2012 at 3:17 PM, Becky Gibson <gi...@gmail.com> wrote:

> I just updated my cordova-ios, cordova-js and cordova-mobile-spec sources.
>  Created a new project and ran the sample app.   All was fine.  Made my
> changes, incorporated the mobile-spec files and started testing.  Silly me
> not to run the mobile-spec against a clean build first.
>
> It seems that in the current code, plugin apis are being called multiple
> (as in 3-6) in the objective-c code for each JavaScript call.   Help
> debugging would be appreciated.
>
> -b
>