Closed beaur closed 8 years ago
Related to https://jira.appcelerator.org/browse/MOD-2168
Due to the new Permission System in Android 6.0, you would need to use
Ti.Media.requestCameraPermissions
The code that needs to be added would be:-
if (Ti.Media.hasCameraPermissions()) {
window.open();
} else {
Ti.Media.requestCameraPermissions(function(e) {
if (e.success === true) {
window.open();
} else {
alert("Access denied, error: " + e.error);
}
});
}
works for me with your code @ashcoding
thanks!!!
Closing issue.
Is there anything else with the new android permissions that this may be needed to be added to?
@blueice349 any thing in particular you are referring to?
Just trying to find out what else will require a permission change in android. Now know Camera does. We also use Signature fields and GPS a lot will GPS require any permission changes?
@blueice349 GPS would require you to request for permissions as well on Android 6.0 You can refer here: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Geolocation-method-requestLocationPermissions
Related doc: http://developer.android.com/training/permissions/requesting.html If there's a permission that you can't request for in Android 6.0, you can create a Jira ticket for it to be addressed.
On a device running Android 6, when the app tries to use the camera to scan the message "Sorry, the Android camera encountered a problem. You may need to restart the device." is shown and the camera cannot be used.