Problem
When deciding how an app should handle an incoming Android Intent, knowing the type, action, and data values that were sent with the Intent are critical. If your app only handles one very specific Intent, this is OK, but if you have an app that handles images, URIs, video,, etc... you need to know these values.
Right now when an Intent is received via Intent Filter in Titanium, the following lists the values/errors you will get for the data, type, and action functions and properties of an Intent:
*
getData()
always equals
null
*
getType()
and
getAction()
always throw this exception, despite the fact that logic and documentation dictates that these functions do not require arguments:
Uncaught Error: Requires property name as first argument
* The
data
property always returns
null
* The
action
and
type
properties always return
undefined
Proposed Solution
The above listed functions and properties need to return the appropriate values for
data
,
type
, and
action
so that developers will know what to do with the Android Intent that they are receiving. Like I said, if you are handling only one type of data as dictated by your Intent Filter, you are OK. But if you plan to handle images, video, etc... and you need to read them from Ti.Android.EXTRA_STREAM, you have no way of knowing which type of Intent you are receiving.
Also, I believe the implementation of
getAction()
and
getType()
need to change so that they do not require a parameter.
Duplicate of TIMOB-7249