[TIMOB-20490] Android: Apps should be able to open/resume and respond to intents
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | High | 
| Status | Closed | 
| Resolution | Fixed | 
| Resolution Date | 2016-09-30T16:22:36.000+0000 | 
| Affected Version/s | Release 5.2.0, Release 5.2.1 | 
| Fix Version/s | Release 6.0.0, Release 6.1.0 | 
| Components | Android | 
| Labels | n/a | 
| Reporter | Fokke Zandbergen | 
| Assignee | Gary Mathews | 
| Created | 2016-03-01T09:30:37.000+0000 | 
| Updated | 2017-01-06T23:29:47.000+0000 | 
Description
Attachments
| File | Date | Size | 
|---|---|---|
| com.alloy.zip | 2016-09-26T18:37:45.000+0000 | 1490484 | 
/cc [~msamah] [~jasonkneen]
[~msamah], [~sliang] Is it okay if I send the above link to client to test it ?
For a classic app, with this Branch: https://github.com/ashcoding/titanium_mobile/tree/TIMOB-20490a 1) Build the app and run it 2) Go to the directory of the app, head to
/build/android/AndroidManifest.xml3) Get the XML for the activities in the application 4) Add the intent-filter to the xmlThe resulting XML will be this.5) Take this and merge it into thetiapp.xml. 6) Add the following code to the top ofapp.jsTi.Android.currentActivity.addEventListener('onIntent', function(e) { // code here is run when the event is fired // properties of the event object 'e' describe the event and object that received it Ti.API.info('The '+e.intent+' event happened'); var intentObj = e.intent; var stringItem = intentObj.getStringExtra("android.intent.extra.TEXT"); if(stringItem){ var win1 = Ti.UI.createWindow({ title:'Received', backgroundColor:'#fff' }); var label1 = Titanium.UI.createLabel({ color:'#999', text: stringItem, }); win1.add(label1); win1.open(); Ti.API.info('Successfully received:'+stringItem); } });packageNameandactivityNamein Android Studio and run the app 9) Click the button in AndroidIntentExample app. It will open the Titanium App and pass the string data. For alloy, it's still being looked into.master: https://github.com/appcelerator/titanium_mobile/pull/8433
will this be released in 6.1 like the other two tickets referenced in that PR? (ticket has no Fix Version/s)
Hey [~acvauctions]! Yeah, this PR was merged to SDK master, which is the current 6.1.0 targeted branch. We have a handful of tickets around the same area, and I think they might be worth trying to get in 6.0.0 - I'll bug Kiat.
[~gmathews] please backport.
cc [~acvauctions] These intent/activity related bug fixes have now beenbackported to 6_0_X, should should be on that branch and in the upcoming 6.0.0 release.
Thank you! :D
Verified fixed, was able to follow the instructions mentioned in the following PR https://github.com/appcelerator/titanium_mobile/pull/8433 *Environment*
Appcelerator Command-Line Interface, version 6.1.0 Android 7.1 (Google Nexus 6P) Operating System Name: Mac OS X El Capitan Operating System Version: 10.11.6 Node.js Version: 4.6.0 npm: 4.2.8 Titanium SDK Version: 6.1.0.v20170105103604 Xcode: 8.0 Appcelerator Studio: 4.8.1.201612050850