Open veerakumareswaran opened 7 years ago
idem!
i have solved the issue in marshmallow 6.0.1 using the cordova.plugins.diagnostic plugin.. i checked the permission WRITE_EXTERNAL_STORAGE, if permission not exist then request the WRITE_EXTERNAL_STORAGE permission... now it's working fine... here is my code
function CheckCreateEvent() { var txtPermission = ["WRITE_EXTERNAL_STORAGE"]; cordova.plugins.diagnostic.getPermissionsAuthorizationStatus(CheckCreatePermissions, CheckCreatePermissionsError, txtPermission); }
//create event upload image check permission success function CheckCreatePermissions(statuses) { var txtPermission = "WRITE_EXTERNAL_STORAGE"; for(var permission in statuses){ var $permission = $('#permissions .'+permission), status = statuses[permission]; if( status != "GRANTED" ){ cordova.plugins.diagnostic.requestRuntimePermission(RequestCreatePermission, RequestCreatePermissionError, txtPermission); } else if( status == "GRANTED" ){ imgupload(); } } } //create event upload image check permission error function CheckCreatePermissionsError(error) { console.log(error); } //create event upload image request permission success function RequestCreatePermission(status) { if(status=="GRANTED"){ imgupload(); } } //create event upload image request permission error function RequestCreatePermissionError() { console.log("failed"); }
the above code works fine.. anyone give exact solution.
Question, do we specifically need to ask permission to the user? or the permission is given automatically when the app is downloaded form the Playstore?
i have add permision to android manifest but still not working in marshmallow
go settings -> apps - UR_APP_NAME -> turn them on probably they are there off.
@ghost It really works for me.I am thankfull to you
i have created application using image picker.. now i am installed the app to marshmallow 6.0 it's working fine.. but its not working in marshmallow 6.1,, if i choose the image picker in marshmallow 6.1 its crash the application and close the app.