Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 310A8D82E for ; Mon, 10 Sep 2012 13:22:08 +0000 (UTC) Received: (qmail 41044 invoked by uid 500); 10 Sep 2012 13:22:07 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 41001 invoked by uid 500); 10 Sep 2012 13:22:07 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 40987 invoked by uid 99); 10 Sep 2012 13:22:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 13:22:07 +0000 Date: Tue, 11 Sep 2012 00:22:07 +1100 (NCT) From: "Andrew Grieve (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1791461310.57504.1347283327821.JavaMail.jiratomcat@arcas> In-Reply-To: <1833000693.48581.1346994789065.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451955#comment-13451955 ] Andrew Grieve commented on CB-1385: ----------------------------------- Hmm, yes, thanks Matthew for figuring out what went wrong here. I think what we could do to fix this is to pop off the null callbackId in CDVInvokedUrlCommand::legacyArguments if it is null/nil. Shaz - We're away today at a company golf off-site. I will fix this tomorrow, but since it's a 2.1 blocker, feel free to take it as well. > 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec > ----------------------------------------------------------------------------------------------- > > Key: CB-1385 > URL: https://issues.apache.org/jira/browse/CB-1385 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS, iOS > Affects Versions: 2.1.0 > Environment: iOS > Reporter: Matthew Windwer > Assignee: Andrew Grieve > Fix For: 2.1.0 > > > This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0. > The issue happens when calling cordova.exec using "FORMAT TWO", e.g: > cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail'); > When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]). > The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js: > var command = [callbackId, service, action, actionArgs]; -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira