Project: titanium
Issue TIMOB-20003: Permission request error response message prefixed with namespace
The following code demonstrates that when you deny permission, the error messages in the callback payload are prefixed by the _namespace_ followed by no spacing. Expected behaviour is not to have a prefix at all. {code:javascript} var win = Ti.UI.createWindow({	backgroundColor: 'white' }); var btn = Ti.UI.createButton({	title: 'Request Permissions' }); btn.addEventListener('click', function(e) {	Ti.Calendar.requestCalendarPermissions(function(e) {	console.log('Ti.Calendar.requestCalendarPermissions ' + JSON.stringify(e, null, 2));	});	Ti.Contacts.requestContactsPermissions(function(e) {	console.log('Ti.Contacts.requestContactsPermissions ' + JSON.stringify(e, null, 2));	});	Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {	console.log('Ti.Geolocation.requestLocationPermissions ' + JSON.stringify(e, null, 2));	});	Ti.Media.requestCameraPermissions(function(e) {	console.log('Ti.Media.requestCameraPermissions ' + JSON.stringify(e, null, 2));	}); }); win.add(btn); win.open(); // So the required users-permissions are added to AndroidManifest.xml function foo() {	Ti.Calendar.getAllCalendars();	Ti.Contacts.getAllGroups();	Ti.Media.showCamera(); } {code} *Console* {code} 11-17 14:11:46.421: I/TiAPI(5178): Ti.Media.requestCameraPermissions { 11-17 14:11:46.421: I/TiAPI(5178): "error": "CameraOne or more permission(s) were denied", 11-17 14:11:46.421: I/TiAPI(5178): "code": -1, 11-17 14:11:46.421: I/TiAPI(5178): "success": false 11-17 14:11:46.421: I/TiAPI(5178): } 11-17 14:11:46.422: I/TiAPI(5178): Ti.Geolocation.requestLocationPermissions { 11-17 14:11:46.422: I/TiAPI(5178): "error": "LocationOne or more permission(s) were denied", 11-17 14:11:46.422: I/TiAPI(5178): "code": -1, 11-17 14:11:46.422: I/TiAPI(5178): "success": false 11-17 14:11:46.422: I/TiAPI(5178): } 11-17 14:11:46.422: I/TiAPI(5178): Ti.Contacts.requestContactsPermissions { 11-17 14:11:46.422: I/TiAPI(5178): "error": "ContactsOne or more permission(s) were denied", 11-17 14:11:46.422: I/TiAPI(5178): "code": -1, 11-17 14:11:46.422: I/TiAPI(5178): "success": false 11-17 14:11:46.422: I/TiAPI(5178): } 11-17 14:11:46.422: I/TiAPI(5178): Ti.Calendar.requestCalendarPermissions { 11-17 14:11:46.422: I/TiAPI(5178): "error": "CalendarOne or more permission(s) were denied", 11-17 14:11:46.422: I/TiAPI(5178): "code": -1, 11-17 14:11:46.422: I/TiAPI(5178): "success": false 11-17 14:11:46.422: I/TiAPI(5178): } {code} Related code: https://github.com/appcelerator/titanium_mobile/blob/a0e6b6545594b64d95dc91a496e3242342de9db1/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java#L440
Story points: 2