{ "id": "115034", "key": "TIMOB-14001", "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": "2013-05-28T16:26:35.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [ { "id": "29973", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "115607", "key": "TIMOB-14139", "fields": { "summary": "Android: Intent extra does not seem to be present if the app is using TabGroup", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-02-28T20:04:06.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": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Description of the problem\r\nWhen clicking on a notification, if we want to restore the app which is in background, is currently not possible to understand if the click comes from the notification or not, as we cannot send extra data\r\n\r\nh2. Use case\r\nWhen clicking on a notification, you want to switch to a particular tab/page of the app. Opening a NEW intent would work (e.g. we can create the intent with extra data), but if we use the currently open one (Ti.Android.currentActivity.intent) there is not way to provide such information.", "attachment": [], "flagged": false, "summary": "Android: Allow sending extra data to the intent when opening a notification", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "256347", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~dcassenti] Could you provide some clarification on what the issue is here? (A sample case would be helpful)\n\nIs there a reason why putExtra() would not work when you are creating a notification?", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-06T00:30:08.000+0000", "updated": "2013-06-06T00:30:08.000+0000" }, { "id": "256421", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ayeung] The problem with putExtra is that, if you do not want to open a new intent, but re-opening the same one, you cannot use it. The idea would be to have something like:\n\n{code}\nvar activity = Ti.Android.currentActivity;\n var intent = activity.getIntent();\n intent.putExtra(Ti.Android.EXTRA_TEXT, \"notification\");\n\nvar pending = Titanium.Android.createPendingIntent({\n intent: intent,\n flags: Titanium.Android.FLAG_UPDATE_CURRENT\n});\n\nvar notification = Titanium.Android.createNotification({\n contentTitle: 'Something Happened',\n contentText : 'Click to return to the application.',\n contentIntent: pending\n});\n\nTi.Android.NotificationManager.notify(1, notification);\n{code}\n\nUsing this code, you are putting the EXTRA information in the current intent, and resuming it from outside the notification will have no difference.", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-06T15:17:14.000+0000", "updated": "2013-06-06T15:17:14.000+0000" }, { "id": "256516", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm not sure I understand the issue. If you call putExtra() on the current intent, back out of the app, and then reopen it with the notification, then intent should have the extra that you placed there.\n\n{code}\nvar activity = Ti.Android.currentActivity;\nvar intent = activity.getIntent();\n\nif (intent.hasExtra(Ti.Android.EXTRA_TEXT)) {\n\tTi.API.info('----------has intent----------');\n\n} else {\n\tTi.API.info('--------------------');\n}\n\nintent.putExtra(Ti.Android.EXTRA_TEXT, \"notification\");\n\nvar pending = Titanium.Android.createPendingIntent({\n\tintent : intent,\n\tflags : Titanium.Android.FLAG_UPDATE_CURRENT\n});\n\nvar notification = Titanium.Android.createNotification({\n\tcontentTitle : 'Something Happened',\n\tcontentText : 'Click to return to the application.',\n\tcontentIntent : pending\n});\n\nTi.Android.NotificationManager.notify(1, notification);\n{code}", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-06T21:41:24.000+0000", "updated": "2013-06-06T21:41:24.000+0000" }, { "id": "256667", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ayeung] Correct, but the intent also has the EXTRA if you resume it NOT from the notification in that case. The code works fine if the intent is new, as the EXTRA is not added to the running one, and resuming without a notification will not 'open' the one with the EXTRA data.\n\nHope it helps", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-07T17:56:17.000+0000", "updated": "2013-06-07T17:56:17.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }