This is a regression. The code in question worked in 3.1.1.
Scenario
I have two apps. One launches the other using
openURL()
and optionally passing launch arguments.
Expected results
Target app receives the intent, accesses URL parameters sent by using
activity.getIntent().getData()
and uses them to take appropriate action.
Actual results
Using Titanium 3.1.2, the source app can open the target app. But, the create event doesn't fire. So I can't grab the payload (the URL parameters) and execute the desired function.
"Source" app:
https://github.com/appcelerator-training/tce_training/tree/master/labcode/Finished_code/08_source
"Target" app:
https://github.com/appcelerator-training/tce_training/tree/master/labcode/Finished_code/URLSchemes
Things I've tried that didn't solve the problem:
* Make the app's window heavyweight
* Put the code within
window.addEventListener('open', function() {// code here})
* Use the window open listener, pass in an event object, try grabbing a handle to the activity from e.source.activity (window was heavyweight)
* Tried listening on the activity's newintent, resume, and start events instead of create
* Added
android:launchMode="singleTask"
to the activity's definition in tiapp.xml
The code as written worked fine in 3.1.1 (and a couple SDKs prior to that too). Downgrading from 3.1.2 to 3.1.1 is all it takes to "fix" the code.
Possibly related to TIMOB-14520 per conversation with Ping
[~skypanther], it seems I have no permission to clone the two apps you mentioned in the ticket. I submitted a PR for TIMOB-14520 https://github.com/appcelerator/titanium_mobile/pull/4622. Can you try it to see if that also solve your issue?
I hate to admit I'm a dummy and don't know how to pull an unmerged branch then build our SDK. But, that's the way it is. I've attached a zip to this ticket containing the two projects. These worked in class using 3.1.1GA. They don't contain any new code from the various attempts I've made to resolve this issue in 3.1.2.
Closing ticket as duplicate and links to the related ticket have been provided above.