Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28507] iOS: Ti.App "arguments" property and getArguments() method are not defined as of 10.0.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-07-21T09:59:51.000+0000
Affected Version/sRelease 10.0.0
Fix Version/sRelease 10.0.1
ComponentsiOS
Labelsapp, arguments, ios, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-07-14T04:26:36.000+0000
Updated2021-07-21T09:59:51.000+0000

Description

*Summary:* As of Titanium 10.0.0, the [Ti.App.arguments](https://titaniumsdk.com/api/titanium/app.html#arguments) property and the deprecated [Ti.App.getArguments()](https://titaniumsdk.com/api/titanium/app.html#getarguments) method are no longer defined. This is a regression and makes fetching an iOS app's arguments via a cold start impossible. *Steps to reproduce:*

Build and run the below code on iOS.

Look at the log.

// app.js
console.log(@@@ Ti.App.arguments: ${JSON.stringify(Ti.App.arguments, null, 4)});
console.log(@@@ Ti.App.getArguments(): ${JSON.stringify(Ti.App.getArguments(), null, 4)});
*Result:* The "arguments" property wrongly returns undefined and the getArguments() method causes a crash because that method no longer exists.
[INFO]  @@@ Ti.App.arguments: undefined
[ERROR] console.log("@@@ Ti.App.getArguments(): ".concat(JSON.stringify(Ti.App.getArguments(), null, 4)));
[ERROR] TypeError: Ti.App.getArguments is not a function. (In 'Ti.App.getArguments()', 'Ti.App.getArguments' is undefined)
*Expected Result:* The arguments property and getArguments() method must always return an object. If no arguments were used to launch the object, then it will be an empty object printed below as {}.
[INFO]  @@@ Ti.App.arguments: {}
[INFO]  @@@ Ti.App.getArguments(): {}

Comments

  1. Joshua Quick 2021-07-14

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12956
  2. Christopher Williams 2021-07-20

    merged to master
  3. Ewan Harris 2021-07-21

    Backported to 10_0_X

JSON Source