wymsee / cordova-imagePicker

Cordova Plugin For Multiple Image Selection
MIT License
407 stars 858 forks source link

cordova image picker marshmallow 6.0.1 not working #190

Open veerakumareswaran opened 7 years ago

veerakumareswaran commented 7 years ago

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.

dariob commented 7 years ago

idem!

veerakumareswaran commented 7 years ago

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.

nicolasguzca commented 7 years ago

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?

GamalSebaee commented 7 years ago

i have add permision to android manifest but still not working in marshmallow

ghost commented 7 years ago

go settings -> apps - UR_APP_NAME -> turn them on probably they are there off.

HR808830 commented 7 years ago

@ghost It really works for me.I am thankfull to you