{ "id": "171721", "key": "TIMOB-26148", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2018-05-31T10:26:51.000+0000", "priority": null, "labels": [ "android", "images", "intent-filter", "intents", "share" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-22T09:15:54.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Currently Titanium SDK only supports receiving single shared image using sharing intent and intent-filters. I couldn't find any way to receive multiple images from shared intent EXTRA_STRAM. It would be good if Titanium support this feature.\r\n\r\nSteps to reproduce:\r\n\r\n1. Follow this guide to setup intent filters show our app in share dialog: [https://docs.appcelerator.com/platform/latest/#!/guide/Android_Intent_Filters|https://docs.appcelerator.com/platform/latest/#!/guide/Android_Intent_Filters]\r\n\r\n2. Add the following intent filter to the main activity inside manifest section in tiapp.xml:\r\n\r\n{code:java}\r\n\r\n\t\r\n\t\r\n\t\r\n\r\n{code}\r\n\r\n3. Add this code to index.js to get shared images from launchIntent:\r\n\r\n{code:java}\r\nif(OS_ANDROID){\r\n\tvar launchIntent = Ti.App.Android.launchIntent;\r\n\tvar extra;\r\n\tif(launchIntent.hasExtra(Ti.Android.EXTRA_STREAM) && (extra = launchIntent.getBlobExtra(Ti.Android.EXTRA_STREAM))){\r\n\t console.log('Recieved external image in intent',extra);\r\n\t}\r\n}\r\n{code}\r\n\r\n4. Run the project and once app is launched open gallery application.\r\n5. Select multiple images and tap share button.\r\n6. From share dialog select our Titanium app.\r\n\r\nActual result:\r\nNothing happens except the following warning in console:\r\n\r\n{code:java}\r\n[WARN] : Bundle: Key android.intent.extra.STREAM expected Parcelable but value was a java.util.ArrayList. The default value was returned.\r\n[WARN] : Bundle: Attempt to cast generated internal exception:\r\n[WARN] : Bundle: java.lang.ClassCastException: java.util.ArrayList cannot be cast to android.os.Parcelable\r\n[WARN] : Bundle: \tat android.os.Bundle.getParcelable(Bundle.java:810)\r\n[WARN] : Bundle: \tat org.appcelerator.titanium.proxy.IntentProxy.getBlobExtra(IntentProxy.java:379)\r\n[WARN] : Bundle: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[WARN] : Bundle: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[WARN] : Bundle: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:936)\r\n[WARN] : Bundle: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1159)\r\n[WARN] : Bundle: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)\r\n[WARN] : Bundle: \tat org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:116)\r\n[WARN] : Bundle: \tat dk.napp.drawer.DrawerProxy.handleMessage(DrawerProxy.java:96)\r\n[WARN] : Bundle: \tat android.os.Handler.dispatchMessage(Handler.java:107)\r\n[WARN] : Bundle: \tat android.os.Looper.loop(Looper.java:179)\r\n[WARN] : Bundle: \tat android.app.ActivityThread.main(ActivityThread.java:5537)\r\n[WARN] : Bundle: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : Bundle: \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n[WARN] : Bundle: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)\r\n[WARN] : Bundle: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)\r\n{code}\r\n\r\nExpected Result:\r\nThe app should receive array of images from launch intent and print the array on console.\r\n\r\nThis link can be helpful in implementing this feature: [https://stackoverflow.com/questions/13378108/androidselecting-multiple-images-in-gallery-and-starting-implicit-intent|https://stackoverflow.com/questions/13378108/androidselecting-multiple-images-in-gallery-and-starting-implicit-intent]", "attachment": [], "flagged": false, "summary": "Add support for \"android.intent.action.SEND_MULTIPLE\" in android intent filters.", "creator": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "subtasks": [], "reporter": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "environment": null, "comment": { "comments": [ { "id": "438068", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you please share native docs on this feature? Our engineers will look into it. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-06-02T04:48:06.000+0000", "updated": "2018-06-02T04:48:06.000+0000" }, { "id": "438505", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~appsol], We can't move this ticket you if don't provide the sufficient information that is needed. Please share the native docs on this feature. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-06-19T10:42:18.000+0000", "updated": "2018-06-19T10:42:18.000+0000" }, { "id": "438544", "author": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "body": "@Sharif AbuDarda The StackOverFlow link I attached has an example. Here is the link to native docs that has an example of *ACTION_SEND_MULTIPLE*: [https://developer.android.com/training/sharing/receive|https://developer.android.com/training/sharing/receive]", "updateAuthor": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "created": "2018-06-20T10:12:13.000+0000", "updated": "2018-06-20T10:12:13.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }