{ "id": "61709", "key": "TIMOB-1077", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11224", "name": "Release 1.4.0", "archived": true, "released": true, "releaseDate": "2010-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:55:08.000+0000", "created": "2011-04-15T02:43:20.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "arguments", "crash", "os4" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:55:08.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Titanium.App.getArguments() seems to not work on Iphone OS4 beta\n4.

\n

When calling a Custom URL schema passing some query strings\narguments, ON the App it does not get the arguments.

\n

Used to work on 3.x

{html}", "attachment": [ { "id": "17928", "filename": "device-log_ks_getargument.txt", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:20.000+0000", "size": 1472, "mimeType": "text/plain" }, { "id": "17927", "filename": "device-log-geo_ks.txt", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:20.000+0000", "size": 5311, "mimeType": "text/plain" }, { "id": "17926", "filename": "kitchensink_2010-06-01-125109_antonio-iphone-3gs.crash", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:20.000+0000", "size": 21794, "mimeType": "application/octet-stream" }, { "id": "17929", "filename": "ks_geo.PNG", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:21.000+0000", "size": 52787, "mimeType": "image/png" } ], "flagged": false, "summary": "Titanium.App.getArguments() not working on OS4 beta4", "creator": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "124781", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Need some more information, including a test case and which\nversion of Titanium you're using.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:21.000+0000", "updated": "2011-04-15T02:43:21.000+0000" }, { "id": "124782", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here are the info.
\nMobile SDK 1.3
\niPhone SDK OS4 beta4

\n

Attached is the console log, running on an iPhone 3Gs with OS4\nbeta4. Using KitchenSink 1.3. (changed the name to be able to use\nmy Profile.

\n

Start KitchenSink 1.3
\nGo to Phone Tab
\nGo to GeoLocation
\nThe data will be filled, only the Reverse Geo data is blank

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:21.000+0000", "updated": "2011-04-15T02:43:21.000+0000" }, { "id": "124783", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry wrong update :-)

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:21.000+0000", "updated": "2011-04-15T02:43:21.000+0000" }, { "id": "124784", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here is the proper additional info for this bug.

\n

Info:
\nTitanium MObile SDK 1.3
\nxcode_3.2.3_and_iphone_sdk_4_beta_4
\niPhone OS4 beta4 for iPhone 3Gs (build:8a274b)

\n

================================================== Steps to\nreproduce on the Device:

\n

Edit the Custom URL handler on info.plist

\n
\n<key>CFBundleURLTypes</key>\n    <array>\n       <dict>\n          <key>CFBundleURLName</key>\n             <string>com.appcelerator.kitchensink</string>\n           <key>CFBundleURLSchemes</key>\n            <array>\n              <string>kitchensink</string>\n            </array>\n        </dict>\n    </array>\n
\n

Now open Safari Mobile on the Device
\ntype the Custom URL passing some query strings:\nkitchensink://?foo=bar
\nKitchen Sink will open and then will crash.

\n

================================================== Find the\nFiles Attached, Crash Log and Console Log.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:22.000+0000", "updated": "2011-04-15T02:43:22.000+0000" }, { "id": "124785", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hard to say if this is a bug on our end. I see

\n
\nTue Jun  1 12:51:08 unknown UIKitApplication:com.acarlos.KitchenSink[0x80c9][1227]\n
\n

In your output, and

\n
\n<string>com.appcelerator.kitchensink</string>\n
\n

in the plist. Was the plist value changed so that you could test\non device?

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:22.000+0000", "updated": "2011-04-15T02:43:22.000+0000" }, { "id": "124786", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Stephen, I needed to change the AppID, so I could use my\nProvisioning Profile and to test on my Device.

\n

But When I run on Simmulator I use the default KitchenSink\nAppID: com.appcelerator.kitchensink

\n

I am doing some more research on this as well.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:22.000+0000", "updated": "2011-04-15T02:43:22.000+0000" }, { "id": "124787", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Try changing the value for the CFBundleURLName key to match the\napplication ID. I don't get crashes in simulator when they match,\nand can't test on device since I don't have a 4.0-capable one\nhandy.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:22.000+0000", "updated": "2011-04-15T02:43:22.000+0000" }, { "id": "124788", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Mistakenly marked as invalid. Didn't know that getX() functions\nwere the same as accessing the X property.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:23.000+0000", "updated": "2011-04-15T02:43:23.000+0000" }, { "id": "124789", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Yeah, this works for me in simulator when the CFBundleURLName\nmatches the application ID.

\n

I will close this ticket if you can confirm that any application\nwhich does not support backgrounding (built for 3.1) running on\ndevice does not crash when the CFBundleURLName and the app ID\nmatch.

\n

(Edited to remove iPhone 4.0 information)

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:23.000+0000", "updated": "2011-04-15T02:43:23.000+0000" }, { "id": "124790", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [76a7494c760ea73db037f719e67ab3a700d8a750])\n[#1077 state:open] plist change to allow KS to\ntest getArguments(). Note that under 4.0, we do not support\nchanging the arguments; this may not even be possible. Have to look\ninto it. \nhttp://github.com/appcelerator/titanium_mobile/commit/76a7494c760ea...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:23.000+0000", "updated": "2011-04-15T02:43:23.000+0000" }, { "id": "124791", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Guys, you are right. It seems that on OS4 I can't get the\narguments when coming from a 'Pause'.

\n

let me give you some more background on what I am trying to\nachieve.

\n

What I am trying to do is an oAuth 3-legged authorization\nprocess with Yahoo!, then my App does the call for authorization\nand opens Safari, after authorizing the app, I have created a\ncallback that calls the Custom URL passing the access token and the\nverifier as arguments. Then my app checks the arguments and\ncompletes the oAuth process.

\n

It worked very well on 3.1, but for 4.0 first I needed to change\nmy startup listener to 'resume', but then the arguments are always\nempty.

\n

Anyway, now I have no Idea how to proceed with the whole oAuth\n3-legged process as Safari will not be able to open back my\nApp.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:23.000+0000", "updated": "2011-04-15T02:43:23.000+0000" }, { "id": "124792", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I would like to be able to give you a workaround, but the NDA\nprevents me from discussing this issue with you further in a public\nforum. All I can recommend is looking through (4.0) documentation\non the relevant subjects.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124793", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Ok, thanks, so will it be possible to retrieve arguments from\nSafari on Titanium 1.4?

\n

What my Safari does e call a callback like this, passing the\noauth verifier and a Token.

\n

Myapp://?oauthv=something&token=otherstuff

\n

This starts my app, but getArguments does not work with\n\"Resume\".

\n

Do you have any suggestion on how to retrieve this data back\nwith my app?

\n

Thanks once again.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124794", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

It is possible to retrieve arguments from Safari, but only on\nstartup. We will very likely not get to this feature in time for\n1.4.0. I can't advise you further until the NDA is up because the\nworkaround does not involve Titanium directly.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124795", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Ok, thanks Stephen.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124796", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

With the advent of iOS4 I can finally give you the bad news.\nWhen apps resume from background, they are NOT passed any new\ninformation about arguments; they are only passed arguments on\nstartup. This means that if it's absolutely critical that your app\nalways be able to get startup argument information, it must opt-out\nof background execution.

\n

You can do this by changing the\nUIApplicationExitsOnSuspend key in the\nInfo.plist file to have a YES value.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124797", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

All right, thanks for the update Stephen.

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:24.000+0000", "updated": "2011-04-15T02:43:24.000+0000" }, { "id": "124798", "author": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

It appears it is possible to receive the URL if the process is\nbackgrounded, but a different approach is required. From the\ndeveloper forums:

\n
\n\n

Also, check that you're using

\n\n

and NOT

\n\n

If you're using the second one, handleOpenURL is ignored.

\n

Would it be possible for Titanium to expose this information in\nthe future? For dictionary and study applications, the ability to\nswitch quickly between them is important.

{html}", "updateAuthor": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:25.000+0000", "updated": "2011-04-15T02:43:25.000+0000" }, { "id": "124799", "author": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

(sorry for the bold, I had only meant to mark off what was\nquoted and what wasn't)

{html}", "updateAuthor": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:25.000+0000", "updated": "2011-04-15T02:43:25.000+0000" }, { "id": "124800", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thank you for pointing this out - it was not covered in any of\nthe backgrounding documentation. I will see if I can get it in\nbefore 1.4.0 drops.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:25.000+0000", "updated": "2011-04-15T02:43:25.000+0000" }, { "id": "124801", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [8c573ed5806e0477e143f40e272314bfe130d054])\nCloses #1077: Apps can now get URLs on return from\nbackgrounding. Thanks to Damien Elmes for the solution. \nhttp://github.com/appcelerator/titanium_mobile/commit/8c573ed5806e0...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:25.000+0000", "updated": "2011-04-15T02:43:25.000+0000" }, { "id": "124802", "author": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks for the quick fix!

{html}", "updateAuthor": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:25.000+0000", "updated": "2011-04-15T02:43:25.000+0000" }, { "id": "124803", "author": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi There,

\n

so do you know how can I get the arguments that are passed from\nan CustomHandle, here is some sample code I am trying, but the\narguments object is empty.

\n

on App.js I have added the following code,\ntrying to trap the data from the customHandle from a Resume or\nOpen

\n
\nvar argu = Ti.App.getArguments();\nvar argumentos = JSON.stringify(argu);\n// var theImage = null; //capture image from gallety and/or camera\n// var theThumbnail = null; //capture image thumbnail from gallety and/or camera\n\n\n// trap app Open event and retrieve the arguments from safari\nTi.App.addEventListener('resume', function(e)\n{\n\nTi.API.info(\"MemePost is being RESUMED, getting Arguments\");\n\nTi.API.info(\"Arguments from RESUME on app.js \" + argu);\n\na = Ti.UI.createAlertDialog({ \n    title:'URL Arguments from RESUME on app.js',\n    message: argu\n});\na.show();\n\n});\n\n// trap app Open event and retrieve the arguments from safari\nTi.App.addEventListener('open', function(e)\n{\n\nTi.API.info(\"MemePost is being OPEN, getting Arguments\");\n\nTi.API.info(\"Arguments from OPEN on app.js \" + argumentos);\n\na = Ti.UI.createAlertDialog({ \n    title:'URL Arguments from OPEN on app.js',\n    message: argumentos\n});\na.show();\n\n});\n
\n

What am I doing wrong?

{html}", "updateAuthor": { "name": "antoniocarlossilveira", "key": "antoniocarlossilveira", "displayName": "Antonio Carlos Silveira", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:26.000+0000", "updated": "2011-04-15T02:43:26.000+0000" }, { "id": "124804", "author": { "name": "lukaso", "key": "lukaso", "displayName": "lukaso", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This change unfortunately doesn't appear to work. When I resume\nmy app with a url, the argument doesn't appear. It only appears\nlater, on pause, and then on the next resume.

\n

Example:
\n1) Start MyApp
\n2) Open Safari (closing MyApp)
\n3) Safari: myapp://first
\n4) MyApp launched to the front. In

\n
\nTi.App.addEventListener('resume', function() {\n  if (Ti.App.getArguments() == 'myapp://') { // this will be true
\n
\n\n\n
\n
\n
\nalert('This is always true the first time resume is called');\n
\n
\n\n\n
\n }\n});\n
\nHowever, on 'pause' the argument is then available.
\n5) Open Safari again with 'myapp://second'. This time\nTi.App.getArguments() returns 'myapp://first'\n

Hopefully this all makes sense. Somehow the value is getting set\ntoo late.

{html}", "updateAuthor": { "name": "lukaso", "key": "lukaso", "displayName": "lukaso", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:26.000+0000", "updated": "2011-04-15T02:43:26.000+0000" }, { "id": "124805", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

You need to use the 'resumed' event. There are two separate\nevents on iOS due to the fact that some information is only\navailable after resuming execution.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:26.000+0000", "updated": "2011-04-15T02:43:26.000+0000" }, { "id": "124806", "author": { "name": "lukaso", "key": "lukaso", "displayName": "lukaso", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks! That solved the problem.

{html}", "updateAuthor": { "name": "lukaso", "key": "lukaso", "displayName": "lukaso", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:43:26.000+0000", "updated": "2011-04-15T02:43:26.000+0000" } ], "maxResults": 26, "total": 26, "startAt": 0 } } }