[TIMOB-4454] Android: Ti.App.getArguments() returns empty string
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T19:12:45.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Paul Dowsett |
Assignee | Eric Merriman |
Created | 2011-06-18T16:13:26.000+0000 |
Updated | 2020-01-09T19:12:45.000+0000 |
Description
As reported by [this user in the Q&A](http://developer.appcelerator.com/question/121261/getarguments-returns-empty-string-on-android) and demonstrated in the following code,
Ti.App.getArguments()
returns an empty string.
var args = Ti.App.getArguments();
Ti.API.debug('args is: ' + args);
Ti.API.debug('stringified args is: ' + JSON.stringify(args));
var win = Ti.UI.createWindow({
backgroundColor : "blue",
exitOnClose:true
});
win.open();
any updates..
are there any work-arounds to this? or a fix locally?
This is a carry over API from Desktop. It needs to be removed from the API on mobile. No arguments can be passed to a mobile application at launch.
Thanks for the quick update, Don. However, this feature works in Appcelerator apps on iOS without issues (please do not remove it!!). Android also supports this feature natively through Intents, viz., getIntent().getData() returns the URI that started the current activity, which can be parsed to retrieve the parameters. Removing this API would severely affect user experience, in that the ability to launch an app from a browser with a specific action request would not be available. Please reconsider. Cheers. YM
Also, Don, please see the question posted in the Q&A for more details. Link is in the bug report above. Thanks.
On Android I was able to get launch parameters read using code below but as of release 1.7.3 this no longer works:
That code now throws an exception on getData() because the currActivity.getIntent() returns null . Is this something that can be looked at?
Old ticket, but I just came across it. This works for me:
@ingo you can close this one
Should I be marking this "fixed"? If so, against which version?
wontfix.... the ticket is that Ti.App.getArguments() doesn't work on android. In reality, it's iOS only: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App-method-getArguments On android, you use Ti.Android.Intent.getData().
Should we make Ti.App.getArguments() on Android call Ti.Android.Intent.getData()? Is there a reasonable cross-platform API we could promote?
I don't think that a symbolic-link from one method to another is a good idea. Perhaps deprecating Ti.App.getArguments() and moving it to Ti.iOS namespace is a better option?
Well, it doesn't have to be a symbolic link. It could be a new API. But I'm trying to get cross-platform parity where reasonable, and perhaps this is a place.
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.