{ "id": "159468", "key": "AC-3487", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-04-18T06:16:56.000+0000", "created": "2016-04-11T15:24:47.000+0000", "labels": [ "Calendars", "SDK", "Titanium", "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-04-19T12:32:32.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hi,\r\nI'm trying to add events and then reminder to that events by using a native module. In Android 6.0.0 and above, application has to ask user for a permission if application is using native calendars. I'm specifying the permission in tiapp.xml and by a method \"requestCalendarPermissions\". My application is working perfect for the previous versions of Android but crashing on Android 6.0.0 and above. I think Titanium SDK (currently using 5.2.0) does not has this permission to work with Calendars for Android 6.0.0. Please fix this issue or suggest me some work around so that I can complete my app. I would be grateful.", "attachment": [], "flagged": false, "summary": "Calendar permissions in Titanium SDK for Android 6.0.0 and above.", "creator": { "name": "muhammadsabir", "key": "muhammadsabir", "displayName": "Muhammad Sabir", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "muhammadsabir", "key": "muhammadsabir", "displayName": "Muhammad Sabir", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "382427", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nThanks for reporting. Actually Titanium SDK (5.2.0.GA) does have the functionality to work with Calendar Permission for Android 6. Also it is recommended to update SDK to latest stable version (5.2.2.GA).\r\nHere is a simple example to try.\r\n*Add permissions in tiapp.xml:*\r\n{code}\r\n \r\n \r\n \t \r\n \t\t \r\n \r\n \r\n{code}\r\n\r\n*app.js*\r\n{code}\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nwin.open();\r\n\r\nfunction calenderTask() {\r\n\tif (Ti.Calendar.hasCalendarPermissions()) {\r\n\t\tshowCalendars(Ti.Calendar.selectableCalendars);\r\n\t} else {\r\n\t\tTi.Calendar.requestCalendarPermissions(function(e) {\r\n\t\t\tif (e.success) {\r\n\t\t\t\tshowCalendars(Ti.Calendar.selectableCalendars);\r\n\t\t\t} else {\r\n\t\t\t\tTi.API.error(e.error);\r\n\t\t\t\talert('Access to calendar is not allowed');\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nfunction showCalendars(calendars) {\r\n\tfor (var i = 0; i < calendars.length; i++) {\r\n\t\tTi.API.info(\"Calender: \"+calendars[i].name);\r\n\t}\r\n}\r\n\r\ncalenderTask();\r\n\r\n\r\n{code}\r\n Building and runnig the app on Android 6 show produce console log similar to the following.\r\n{code}\r\n[INFO] : Calender: Birthdays\r\n[INFO] : Calender: Holidays \r\n{code}\r\nThanks\r\n\r\n\r\n*Environment*:\r\n\r\n*Device info:* Nexux7 (android 6.0.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.2.2.GA and 5.2.1.GA\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.4.0.201511241829", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-12T05:56:00.000+0000", "updated": "2016-04-12T05:56:00.000+0000" }, { "id": "383123", "author": { "name": "muhammadsabir", "key": "muhammadsabir", "displayName": "Muhammad Sabir", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi again,\r\nActually I'm using a third party module as I want to create recurrent reminders and sometimes I've to delete them within the applications. When I create events without using this module my app works fine but when I use my module it is not working. I'm explicitly asking for calendar permissions from user as well.\r\nYou can find my test case here,\r\nhttps://www.dropbox.com/s/r8h14gsx5nrss45/Test%20App.zip?dl=0", "updateAuthor": { "name": "muhammadsabir", "key": "muhammadsabir", "displayName": "Muhammad Sabir", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-19T12:31:28.000+0000", "updated": "2016-04-19T12:32:32.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }