{ "id": "169847", "key": "AC-5216", "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": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2017-10-25T22:50:00.000+0000", "created": "2017-09-20T22:00:38.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-07-18T07:34:55.000+0000", "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" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hi,\r\n\r\nHaving a strange issue requesting permissions with Android. Running the following code on first run will not show the SUCCESS log, the callback does not fire. But once the permissions are set and the app is closed and re-opened, the code runs as expected.\r\n\r\n{code:java}\r\nvar permissions = ['android.permission.CAMERA', 'android.permission.READ_EXTERNAL_STORAGE'];\r\nTi.Android.requestPermissions(permissions, function(e) {\r\n if (e.success) {\r\n Ti.API.info(\"SUCCESS\");\r\n } else {\r\n Ti.API.info(\"ERROR: \" + e.error);\r\n }\r\n});\r\n{code}\r\n\r\nThis is right out of the documentation here\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android\r\n\r\nPlease advise if I am doing something wrong here.\r\n\r\nThanks\r\n", "attachment": [], "flagged": false, "summary": "Ti.Android.requestPermissions callback not firing when first requesting permissions", "creator": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tried with SDK 6.0.1.GA,6.1.1.GA,6.1.2.GA\r\nMacOS Sierra 10.12.6\r\nAndroid 7.1.1\r\nEssential Device PH-1", "comment": { "comments": [ { "id": "428241", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "Make sure you have:\r\n{code:xml}\r\n\r\n \r\n \r\n \t\r\n \r\n\r\n{code}\r\nin your tiapp.xml file. I was not able to reproduce the issue on any version from 6.0.1.GA to 6.2.0.GA on Android 7 device, having these lines added.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-09-21T10:48:43.000+0000", "updated": "2017-09-21T10:49:46.000+0000" }, { "id": "429397", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~eric.harms@gmail.com], did you tried [~ybanev], guide?", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-10-22T21:33:07.000+0000", "updated": "2017-10-22T21:33:07.000+0000" }, { "id": "439266", "author": { "name": "silva.jordan", "key": "silva.jordan", "displayName": "Jordan Silva", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi @Sharif AbuDarda and @Yordan Banev, \r\nI'm facing a similar problem. \r\n\r\nWhen I'm trying to requestCalendarPermissions and the user on Android haven't given the permission, the callback is not being fired.\r\n\r\nSteps:\r\na. The user doesn't have allowed the access to the calendar for the app. (i.e., calendar permission);\r\nb. The Calendar Permission is requested through the Ti.Calendar.requestCalendarPermission(callback);\r\nc. The user accepts or denies the permission.\r\nd. The event callback is not fired to inform if the user has accepted or not. :(\r\n\r\n", "updateAuthor": { "name": "silva.jordan", "key": "silva.jordan", "displayName": "Jordan Silva", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-17T14:53:16.000+0000", "updated": "2018-07-17T14:53:16.000+0000" }, { "id": "439294", "author": { "name": "silva.jordan", "key": "silva.jordan", "displayName": "Jordan Silva", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please ignore my previous comment. \r\nI found the bug, was something related to the showing a window (like a dialog) before requesting the permissions, so the request dialog was not being fired.", "updateAuthor": { "name": "silva.jordan", "key": "silva.jordan", "displayName": "Jordan Silva", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-18T07:34:55.000+0000", "updated": "2018-07-18T07:34:55.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }